The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

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!