https://www.xin3721.com/eschool/pythonxin3721/
在python3.4中,原来的 Tkinter 变成 tkinter ,原来的tkMessageBox变成tkinter.messagebox,使用方式如下:
importtkinter.messagebox
tkinter.messagebox.askokcancel('提示','这是一个消息框')
效果如下:
备注:
tkinter.messagebox中有如下函数:
askokcancel(title=None, message=None, **options)
Ask if operation should proceed; return true if the answer is ok
askquestion(title=None, message=None, **options)
Ask a question
askretrycancel(title=None, message=None, **options)
Ask if operation should be retried; return true if the answer is yes
askyesno(title=None, message=None, **options)
Ask a question; return true if the answer is yes
askyesnocancel(title=None, message=None, **options)
Ask a question; return true if the answer is yes, None if cancelled.
showerror(title=None, message=None, **options)
Show an error message
showinfo(title=None, message=None, **options)
Show an info message
showwarning(title=None, message=None, **options)
Show a warning message
Python GUI编程(Tkinter):https://www.runoob.com/python/python-gui-tkinter.html