GUIs: wxPython vs. Tkinter (and others)

Peter Hansen peter at engcorp.com
Sat Dec 11 19:35:48 CET 2004


Jarek Zgoda wrote:
> Fredrik Lundh wrote:
>>> I don't know about wxPython, but PyQt includes it's own threading
>>> facility, plus hooks to talk to databases.
>>
>> That would of course be a great argument if Python didn't already have
>> a threading facility, and a standard API for talking to databases with
>> implementations for all major players.
> 
> Python threading is not perfect in many cases in GUI programming -- you 
> have to implement your own notification mechanism (eg. using queue 
> polling), as usually you can communicate with GUI only from main 
> application's thread. 

With wxPython, PostEvent (which is what CallAfter also uses) is
threadsafe and can be used from any thread, allowing you to
communicate (in this direction, at least) with the GUI thread
from any regular Python thread.  No need for special threads
provided by the framework and, in fact, even though wxWidgets
(on which wxPython is built) provides a wxThread class, it
is not exposed in wxPython because it is redundant there.

-Peter



More information about the Python-list mailing list