0
我学习Python的Tkinter的基本面,并不能得到所谓我的方法“提交()”,力主对我的条目1变量的字符串值。 我曾尝试获得()方法条目1,但控制台说的get属性不为条目1存在。的Python的Tkinter - 吵了输入字符串输入()
from tkinter import *
Window = Tk()
def Submit():
Answer = Entry1.text
if Answer == "byte":
print("correct")
Label(Window, text="What do you call 8 bits?").grid(row=0)
Entry1 = Entry(Window, text="").grid(row=1)
Button(Window, text="SUBMIT", command=Submit).grid(row=2)
Window.mainloop()