关于python的tkinter的问题
大佬帮我......为什么我下面的代码会报错?
from tkinter import*
messagebox.asokcancel("Fishc demo","发射核弹?")
mainloop()
{:9_241:}
会报错:
Traceback (most recent call last):
File "C:\Users\x1c\Desktop\python\项目\tk_1.py", line 3, in <module>
messagebox.asokcancel("Fishc demo","发射核弹?")
NameError: name 'messagebox' is not defined
求助求助求助求助求助求助求助求助求助求助求助
from tkinter import messagebox这样导入 Charles未晞 发表于 2019-2-27 18:44
这样导入
莫有用 Charles未晞 发表于 2019-2-27 18:44
这样导入
from tkinter import messagebox
messagebox.asokcancel("Fishc demo","发射核弹?")
mainloop()
Traceback (most recent call last):
File "C:\Users\x1c\Desktop\python\项目\tk_1.py", line 4, in <module>
messagebox.asokcancel("Fishc demo","发射核弹?")
AttributeError: module 'tkinter.messagebox' has no attribute 'asokcancel' chenyiyun 发表于 2019-2-27 19:16
tkinter.messagebox.askokcancel
你拼错了 哦
Charles未晞 发表于 2019-2-27 21:19
你拼错了
from tkinter import*
from tkinter import messagebox
messagebox.askokcancel("Fishc demo","发射核弹?")
mainloop()
页:
[1]