# -*- coding: utf-8 -*- import tkinter as tk root = tk.Tk() root.title("tk28.py") root.geometry("200x100") ##################################### menubar = tk.Menu(root) menu_file = tk.Menu(menubar, tearoff = 0) menu_file.add_command(label = 'Open') menu_file.add_command(label = 'Save') menu_file.add_separator() menu_file.add_command(label = 'Close') menubar.add_cascade(label = 'File', menu = menu_file) menu_edit = tk.Menu(menubar, tearoff = 0) ## submenu = tk.Menu(menu_edit, tearoff = 0) submenu.add_command(label = 'Cut') submenu.add_command(label = 'Copy') submenu.add_command(label = 'Paste') menu_edit.add_cascade(label = 'Operation', menu = submenu) ## menu_edit.add_command(label = 'Search') menubar.add_cascade(label = "Edit", menu = menu_edit) root.config(menu = menubar) ##################################### root.mainloop()