我需要帮助将“textvariable”更改为int var。这是我的代码:
from Tkinter import *
root = Tk()
strfname = IntVar()
strlname = IntVar()
labelf = Label(root, text = 'number').pack()
fname = Entry(root, justify='left', textvariable = strfname).pack()
labell = Label(root, text = 'number 2').pack()
lname = Entry(root, justify='left', textvariable = strlname).pack()
root.mainloop()
谢谢!
答案 0 :(得分:1)
使用.get
number_variable = strfname.get()