我的 tkinter 代码不断出现错误,我在执行 .get() 时遇到问题,我该如何解决?
from tkinter import *
root = Tk()
filler = Label(root, text="").pack()
from random import randrange as num
a = num(10)
enterr = Entry(root).pack()
def Send():
if enterr.get() > a:
lab = Label(root, text="your guess is too big try again").pack()
elif enterr.get() < a:
lab = label(root, text="your guess is too small try again").pack()
else:
lab = Label(root, text="You got it!")
filler2 = Label(root, text="").pack()
button = Button(root, text="Guess a number from 0 - 10", command=Send).pack()
root.mainloop()