Multithreaded GUI programming

Adam Langley usenet at imperialviolet.org
Fri Dec 6 07:40:28 EST 2002


On Fri, 06 Dec 2002 12:56:30 +0200, Michael 'Mickey' Lauer wrote:

> In Python, the situation is different, since I can't overload the main loop - it would be
> much to slow (let alone, that the internal gui main loop functions are private and thus are not
> exported). Even if I could, in Python I'd rather use Queues than pipes - and a Queue is nothing
> which can just be added to a select call.

Generally you would use thread objects like 
http://www.python.org/doc/current/lib/event-objects.html, but since you
don't have control of the main loop this is mostly out of the question.

However, most GUI toolkits provide a way to listen on file descriptors to 
solve this sort of problem. There's no reason why you can't still use an
os.pipe. Write a byte to the pipe as a signaling system and pass the
actual data over a Queue.




More information about the Python-list mailing list