我有需要改变widget的状态的程序,但问题是我不断收到此错误:入门配置错误
Traceback (most recent call last):
File "C:\Users\Public\Documents\Programming\Spellox\Spellox.py", line 67, in <module>
new_word()
File "C:\Users\Public\Documents\Programming\Spellox\Spellox.py", line 37, in new_word
entry['state'] = DISABLED
TypeError: 'NoneType' object does not support item assignment
谁能帮助这里是我的入门部件代码:
from tkinter import *
import time
root = Tk()
entry = Entry(root, fg='blue', textvariable=check_var).pack(side=TOP)
def change():
time.sleep(3)
entry['state'] = DISABLED
change()
root.mainloop()
在此先感谢!
虽然你说的是真的,代码的作用,你没有解决真正的问题是什么(提示:它与使用拉姆达无关) –
@BryanOakley:谢谢你的提示。让我添加一个101。 – iCodez