dking (1) [Avatar] Offline
I want to run a Tkinter app but _not_ freeze the python console with .mainloop(). I may want , e.g. to continue to add widgets interactively or with a script, or (most importantly) send commands via python to a custom widget that is part of the gui.

I see various apps that do this (e.g. matplotlib.plot on top of Tkinter), and an 'interactive' parameter to _tkinter.create, but that parameter is turned off in the _tkinter.create call within the Tk class constructor in

What gives? What's the right (==(hopefully) easy) way to do this?

direct replies to also welcome.


David King
Jabapyth (9) [Avatar] Offline
Re: keeping the python console alive
this is something i just figured out, a few days ago:

from Tkinter import *
from threading import Thread

Thread(target=root.mainloop).start() ## DONOT put the () after mainloop
## Now do whatever you want!