-2
該變量顯然未定義,儘管它已被使用。代碼是hereNameError:name'questionTextOne'未定義
正如你所看到的,我試圖將變量聲明爲全局變量。
完整的錯誤:
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\matth\AppData\Local\Programs\Python\Python35-32\lib\tkinter\__init__.py", line 1550, in __call__
return self.func(*args)
File "C:\Users\matth\OneDrive\Documents\Assesment.py", line 145, in incorrect
unpackOne()
File "C:\Users\matth\OneDrive\Documents\Assesment.py", line 173, in unpackOne
questionTextOne.pack_forget()
NameError: name 'questionTextOne' is not defined
在外部範圍內沒有'questionTextOne'對象 –
也提供[mcve](https://stackoverflow.com/help/mcve),並非所有的項目代碼 –
請不要鏈接到外部的代碼現場。 –