470,591 Members | 2,146 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,591 developers. It's quick & easy.

Re: Proposal for thread-safe Tkinter

Allen Taylor wrote:
I was given the task of upgrading a Python/Tkinter GUI application to
the latest versions of Python and Tk. After a while, I realized that the
application had not been written in a thread-safe manner. Multiple
threads would simply use the Tk object directly. The application
apparently ran fine (i.e., didn't crash!) using older versions of Python
(2.2) and Tk (8.3), but it started to have serious problems (i.e.,
crashing) after using the latest versions.

The problem is that there isn't enough budget to fix the whole
application. So, I invested a bit of time to develop mtTkinter, a
thread-safe version of Tkinter. Importing mtTkinter actually modifies
the original Tkinter in such a way to make it thread-safe, recognizing
and diverting out-of-thread calls to the Tk object creation thread via a
queue and an 'after' event. I think it works quite well, requiring
basically no changes to the application other than to import mtTkinter
instead of (or in addition to) Tkinter. Even packages that use Tkinter
(e.g., Pmw) benefit.

I would like to contribute this module (single file, about 160 lines) to
the Python community, but I don't know how. I'm new to Python and am not
initiated in the deep Pythonic developer world. Can someone give me some
pointers? Many thanks.
You can publish it in the Python package index - see


If you want to have it considered for inclusion into future versions of
Python then you should post a bug to bugs.python.org wiht your patch as
an attachment and the test of the above mail as a rationale for the change.

Thanks for going to these lengths to contribute!

Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/

Oct 27 '08 #1
0 806

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

15 posts views Thread by Ralf W. Grosse-Kunstleve | last post: by
8 posts views Thread by Micah Elliott | last post: by
23 posts views Thread by Shane Hathaway | last post: by
9 posts views Thread by corey.coughlin | last post: by
1 post views Thread by Bruce Frederiksen | last post: by
7 posts views Thread by python-pep | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.