The tkinter menu is a top-level pulldown menu. They are shown just under the title bar, as you’d expect from traditional gui apps.
The menu can have multiple sub menus and each sub menu can contain items. Menu items can be associated with callback methods, meaning when you click them a Python method is called.
Related course: Tkinter GUI Application Development Projects
Adding a menu is very straightforward, but it can be a bit confusing if it’s the first time you’re doing it. First create the top menu with these lines:
self.master = master
Then you can add menus to this menu:
fileMenu = Menu(menu)
Each of those sub menus can have items:
Menu items can be clickable, you can specify the callback method in the same way as buttons (command=). The click will then call a Python method.
The menu example below adds a menu to a basic tkinter window. It has one clickable menu item but shows a complete menu.
from tkinter import *