1 编写一个导航栏
1 from tkinter import * 2 3 root = Tk() 4 root.title("测试") 5 root.geometry("400x400+400+200") 6 root.resizable(width = False, height = False) 7 8 def hello() : 9 print("hello boy") 10 11 menubar = Menu(root) 12 menubar.add_command(label = "hello", command = hello) 13 menubar.add_command(label = 'quit', command = root.quit) 14 15 root.config(menu = menubar) 16 17 root.mainloop()