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()
时间: 2024-12-29 09:31:31
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()