[IPython-dev] Detecting GUI mainloop running in IPython

Gael Varoquaux gael.varoquaux@normalesup....
Sun Jul 25 13:10:42 CDT 2010


With the 0.11 series of IPython, I no longer understand how the
interaction with the GUI mainloop occurs:

----------------------------------------------------------------------
$ ipython -wthread

In [1]: import wx

In [2]: wx.App.IsMainLoopRunning()
Out[2]: False
----------------------------------------------------------------------

----------------------------------------------------------------------
$ ipython -q4thread
In [1]: from PyQt4 import QtGui

In [2]: type(QtGui.QApplication.instance())
Out[2]: <type 'NoneType'>
----------------------------------------------------------------------

Is there a mainloop running or not? If not, I really don't understand how
I get interactivity with GUI windows and I'd love an explaination or a
pointer.

The problem with this behavior is that there is a lot of code that checks
if a mainloop is running, and if not starts one. This code thus blocks
IPython and more or less defeats the purpose of the GUI options.

Cheers,

Gaël


More information about the IPython-dev mailing list