【发布时间】:2022-01-17 02:36:34
【问题描述】:
window = tkinter.Tk()
window.geometry('700x700')
text_eingabe = Entry(window)
text_eingabe.place(x = 250, y = 550)
def coords():
xy = int(text_eingabe.get())
C.create_line(10,10,{xy},200, fill= 'blue')
eingabe_bestätigung = Button(window, text= 'bitte bestätigen', command= coords)
eingabe_bestätigung.place(x = 250, y= 500)
C = Canvas(window, bg = 'white',width= 300, height= 300)
C.place(x= 170, y= 100)
window.mainloop()
问题是我收到一个名为“屏幕距离差”的错误 当我试图将数字放入输入框中以将这些数字“转换”为行的变量时
【问题讨论】:
-
请在您的问题中包含完整的错误。
-
只需使用
C.create_line(10, 10, xy, 200, fill= 'blue')。大括号放在变量周围时会创建一个set。
标签: python tkinter tkinter-canvas tkinter-entry