Skip to content
Advertisement

unbound method mainloop() must be called with Tk instance as first argument (got nothing instead)

The below code is a simple code which I tried to check if Tkinter worked…

JavaScript

Acoording to https://www.tutorialspoint.com/python/python_gui_programming.html

this should open a blank window

But the following error message was received

JavaScript

Any suggestions…

Advertisement

Answer

Tkinter.Tk() creates an instance of Tk() object which act as argument for mainloop. Do this instead:

JavaScript

Read this for further understanding. tkinter-understanding mainloop

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement