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

Michiel Jan Laurens de Hoon mdehoon at c2b2.columbia.edu
Mon Nov 14 20:00:56 CET 2005

Ronald Oussoren wrote:

> I wonder why nobody has suggested a seperate thread for managing the  
> GUI and
> using the hook in Python's event loop to issue the call to update_plot.
Ha. That's probably the best solution I've heard so far, short of adding 
a Tcl-like event loop API to Python.
There are two remaining issues though:
1) Currently, there's only one PyOS_InputHook. So we're stuck if we find 
that some other extension module already set PyOS_InputHook. An easy 
solution would be to have an PyOS_AddInputHook/PyOS_RemoveInputHook API, 
and let Python maintain a list of input hooks to be called.
2) All extension modules have to agree to return immediately from a call 
to the hook function. Tkinter currently does not do this.


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