问题描述
我的输入框不起作用,我不知道为什么...如果我从脚本中删除 messageBox
;我可以在输入框中输入内容,但如果我再次在脚本中输入 messageBox
,输入框将无法工作。
这是我的代码:
import tkinter
root=tkinter.Tk()
tkinter.messageBox.askquestion("Day","Is this a new day?")
points =0
def subtracted():
points = int(pointsToSubtract.get())
currentpoints=20
currentpoints=currentpoints - points
pointLabel.config(text=currentpoints+" total points")
pointLabel = tkinter.Label(root,text="20 points" )
pointLabel.grid(row=0,column=0)
pointsToSubtract = tkinter.Entry(root)
pointsToSubtract.grid(row=1,column=0)
subPoint = tkinter.Button(root,text="Subtract points",command=subtracted)
subPoint.grid(row=2,column=0)
root.mainloop()
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)