Multithreading tkinter question

Mark English Mark.English at liffe.com
Thu Dec 16 07:31:38 EST 2004


> Date: Thu, 16 Dec 2004 11:59:53 GMT
> From: "John Pote" <johnpote at blueyonder.co.uk>
> 
> "Mark English" <Mark.English at liffe.com> wrote in message 
> news:mailman.7804.1103134911.5135.python-list at python.org...
> Is there a safe way to run tkinter in a multithreaded app 
> where the mainloop runs in a background thread ?
> 
> 
> I tried your code snippet with Python 2.3.4. Worked fine. 
> Only problem was 
> that the program fell off the end and terminated before the 
> second thread 
> could open the Tkinter window.
John,
Thanks for trying that out. I hadn't thought to try another version of
python. I should have said that the example code snippet was for entry
at the command prompt rather than putting in a module or script.

I've tried with activestate Python 2.3.2 and it worked fine.

When I submitted the code I was using my own build of Python 2.4.
On another machine I installed Python2.4 and pywin32-203.win32-py2.4 to
ensure I hadn't messed my build up.
Running a normal Tkinter test works fine. Running the test code I
submitted at the python prompt (or rather putting the function in a
module and calling it from the python prompt as indicated in the test
code) caused the Tkinter window to come up on the taskbar, but it was
invisible. I can only minimize and attempt to close it - close reports
that I will have to kill the program. In other words, it appears to be
broken.

Has anyone else seen any similar problems with Python 2.4 or,
conversely, does it all work ok ? Having now seen the code work with
activestate Python 2.3.2 there's this tantalising prospect that it all
might "just work" after all.

Cheers,
mE


-----------------------------------------------------------------------
The information contained in this e-mail is confidential and solely 
for the intended addressee(s). Unauthorised reproduction, disclosure, 
modification, and/or distribution of this email may be unlawful. If you 
have received this email in error, please notify the sender immediately 
and delete it from your system. The views expressed in this message 
do not necessarily reflect those of LIFFE Holdings Plc or any of its subsidiary companies.
-----------------------------------------------------------------------




More information about the Python-list mailing list