Python Tkinter - add external function as command in menu Python Tkinter - add external function as command in menu tkinter tkinter

Python Tkinter - add external function as command in menu


Commands should give the name of the method. What you're doing is calling the method. Tkinter will then use the return value of that method as the button command. Solution: leave out the brackets.

..., command=file.open

instead of

..., command=file.open()

You did it right for the exit button though!