[Python-Dev] Event loops, PyOS_InputHook, and Tkinter

Michiel Jan Laurens de Hoon mdehoon at c2b2.columbia.edu
Mon Nov 14 02:04:55 CET 2005

Greg Ewing wrote:

>Michiel Jan Laurens de Hoon wrote:
>>I have an extension module for scientific visualization. This extension 
>>module opens one or more windows, in which plots can be made.
>What sort of windows are these? Are you using an existing
>GUI toolkit, or rolling your own?
Rolling my own. There's not much GUI to my window, basically it's just a 
window where I draw stuff.

>>For the graphics windows to remain responsive, I need to make sure that 
>>its events get handled. So I need an event loop.
>How about running your event loop in a separate thread?
I agree that this works for some extension modules, but not very well 
for extension modules for which graphical performance is critical (see 
my reply to Martin). Secondly, I think that by thinking this through, we 
can come up with a suitable event loop framework for Python (probably 
similar to what Skip is proposing) that works without having to resort 
to threads. So we give users a choice: use the event loop if possible or 
preferable, and use a thread otherwise.


Michiel de Hoon
Center for Computational Biology and Bioinformatics
Columbia University
1150 St Nicholas Avenue
New York, NY 10032

More information about the Python-Dev mailing list