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

"Martin v. Löwis" martin at v.loewis.de
Sun Nov 13 14:50:20 CET 2005


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. Something 
> similar to the plotting capabilities of Matlab.
> 
> For the graphics windows to remain responsive, I need to make sure that 
> its events get handled. So I need an event loop. At the same time, the 
> user can enter new Python commands, which also need to be handled.

My recommendation: create a thread for the graphics window, which runs
the event loop of the graphics window. That way, you are completely
independent of any other event loops that may happen. It is also
independent of the operating system (as long as the thread module
is available).

Regards,
Martin


More information about the Python-Dev mailing list