I am new to programming and am trying to create a menu in Python with the Tkinter package. But whenever I run the script in IDLE, all that is displayed is the top level (root) window.
Here is my script:
from tkinter import *
from tkinter import ttk
root.option_add('*tearOff', False)
menubar1 = Menu(root)
root.configure(menu = menubar1)
file = Menu(menubar1)
edit = Menu(menubar1)
help_ = Menu(menubar1)
tools = Menu(menubar1)
other = Menu(menubar1)
menubar1.add_cascade(menu = file, label = 'File')
menubar1.add_cascade(menu = edit, label = 'Edit')
menubar1.add_cascade(menu = help_, label = 'Help')
menubar1.add_cascade(menu = tools, label = 'Tools')
menubar1.add_cascade(menu = other, label = 'Other')
Any idea why?
Thanks in advance.
tkinter.Tkinstance (probably saved inroot) and theroot.mainloop. If I add those parts, it shows up fine for me.tkinterso sometimes can be conflict. But IDLE is only tool to develop code and when code is ready then you don't use IDLE to run it.root = tkinter.Tk())