python实例代码之颜色选择器对话框,代码如下:
#!/bin/python #edit by www.jb200.com from Tkinter import * from tkMessageBox import * from tkColorChooser import askcolor from tkFileDialog import askopenfilename def callback(): askcolor() errmsg = 'Error!' Button(text='Quit', command=callback).pack(fill=X) Button(text='Spam', command=(lambda: showerror('Spam', errmsg))).pack(fill=X) mainloop()
效果图,如下: