[IPython-dev] Status of IPython+GUI+Threads+PyOS_InputHook
Hans Meine
hans_meine at gmx.net
Thu Mar 5 07:18:08 EST 2009
On Sunday 08 February 2009 21:53:54 Gael Varoquaux wrote:
> I have given a lot of thought to this, and I believe that to avoid
> freezing, there is no other option than multiple processes.
I just wanted to chime in again and mention that this is also the approach we
(the VIGRA developers, i.e. mainly Ullrich Köthe and me) took with our PyQt-
based interactive python terminal ('pyterm', not officially released, although
some versions should be floating around the WWW). I am not very fond of its
actual code and state, but the basic design of separate front- and backend has
paid out AFAICS.
Ulli had actually designed a very simple socket protocol between the two
processes, with commands for communicating e.g. I/O and completions.
I think that that should better be factored out, i.e. one should have proxy
objects that behave like their counterparts in the opposite processes, such
that it becomes possible (or at least less work) to directly wire a frontend
and backend in the same process, too. (In the past, I needed this for easy
embedding of the terminal widget in a Qt program of mine, with direct access
to the embedding program's state.)
One big advantage of the separation was *proper* Ctrl-C handling. The main
disadvantage was that API was needed to access the frontend's UI from the
backend; Ulli introduced this to be able to add menu entries from within the
backend.
HTH,
Hans
More information about the IPython-dev
mailing list