Namerror while using tkinter Namerror while using tkinter tkinter tkinter

Namerror while using tkinter


You're trying to use self outside of the scope of a class. You also have the problem that you're trying to attach the menubar to a frame. Only toplevel windows (instances of Tk and Toplevel) can have a menubar associated with it.

You need to change the offending line to this:

root.config(menu=app.menubar)