Concerned_Citizen
Concerned_Citizen

Reputation: 31

mainloop prevents Tkinter application to run from the IDLE

When using Ubuntu, I am able to play with Tk in real-time, by writing commands in the IDLE.

On Windows, I need to call root.mainloop() to spawn a window, and the loop keeps me from running any code from IDLE.

Is it a matter of platform, or am I doing something wrong?

Upvotes: 1

Views: 717

Answers (1)

Amarok
Amarok

Reputation: 910

I don't have a complete solution or answer, but here is something that I found on the subject:

From this page: Thinking in Tkinter

Note that you should not run these programs under IDLE. IDLE is itself a Tkinter application, with its own "mainloop" that will conflict with the mainloop in these programs. If you really want to view and run these programs using IDLE, then -- for each program -- you should comment out the "mainloop" statement in the program before running it.

I'm not too sure about the technical reasons behind it -- but I just don't run Tkinter code from IDLE.

Upvotes: 1

Related Questions