from tkinter import *
t=Tk()
t.title("复选框")
t.geometry("300x300")
m=Menu(t)
m1=Menu(m)
m.add_cascade(label="File",menu=m1)
for i in ["New File","Open","Exit"]:
m1.add_command(label=i)
m2=Menu(m)
m.add_cascade(label="Edit",menu=m2)
for i in ["Undo","Redo","Cut"]:
m2.add_command(label=i)
m3=Menu(m)
m.add_cascade(label="Run",menu=m3)
for i in ["New File","Open","Exit"]:
m2.add_command(label=i)
t.config(menu=m1)
t.mainloop()