python内置对话框、敬告对话框等。
代码:
#!/bin/python #edit by www.jb200.com from Tkinter import * from tkMessageBox import * def callback(): if askyesno('Verify', 'Quit?'): showwarning('Yes', 'Quit not yet implemented') else: showinfo('No', 'Quit has been cancelled') errmsg = 'Error!' Button(text='Quit', command=callback).pack(fill=X) Button(text='Spam', command=(lambda: showerror('Spam', errmsg))).pack(fill=X) mainloop()
效果图,如下: