1 #选项菜单 2 from tkinter import * 3 root = Tk() 4 variable=StringVar() 5 variable.set('one') 6 w = OptionMenu(root,variable,'one','two','three') 7 w.pack() 8 9 mainloop()
1 #选项菜单 2 from tkinter import * 3 root = Tk() 4 variable=StringVar() 5 variable.set('one') 6 w = OptionMenu(root,variable,'one','two','three') 7 w.pack() 8 9 mainloop()