0

我收到此错误:

Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python36-32\lib\tkinter\__init__.py", line 1699, in __call__ return self.func(*args)
File "C:\Users\Administrator\Desktop\Base\utility.py", line 68, in clear
askyesno('Clear', 'Press YES or NO')
NameError: name 'askyesno' is not defined

当我尝试运行它时:

if askyesno('Clear', 'Press YES or NO'):
 do some code

我已经尝试tkMessageBox.askyesno但仍然收到错误。

4

1 回答 1

0

试试这个from tkinter import messagebox导入messagebox然后:

 if messagebox.askyesno('Clear', 'Press YES or NO'):
于 2018-11-04T16:30:40.927 回答