Hi Fernando and others,<br><br>I'm developing an IDE for Python (<a href="http://code.google.com/p/iep/" target="_blank">http://code.google.com/p/iep/</a>) that is capable of integrating the event loop of several GUI toolkits. On a side note, I used much code of IPython as inspiration on how to do that, so thanks for that.<br>

<br>I saw in the IPython documentation that IPython users can detect whether IPython hijacked the event loop as follows (for wx):<br><br>try:<br>    from IPython import appstart_wx<br>    appstart_wx(app)<br>except ImportError:<br>

        app.MainLoop()<br><br>A very nifty feature indeed. However, building further on this, wouldn't it be nice if people could perform this trick regardless of in which IDE or shell the code is running? Therefore I propose to insert an object in the GUI's module to indicate that the GUI event loop does not need to be entered. I currently use for my IDE:<br>

<br>import wx<br>if not hasattr(wx, '_integratedEventLoop'):<br>    app = wx.PySimpleApp()<br>    app.MainLoop()<br><br>Currently, _integratedEventLoop is a string with the value 'IEP', indicating who hijacked the main loop. I'm not sure what IPythons appstart_* function does, but the inserted object might just as well be a function that needs to be called (using the app instance as an argument, but how to call it for fltk or gtk then?). <br>

<br>I'm interested to know what you think of this idea.<br>  Almar<br><br>PS: for PyQt4, I would propose inserting the object both in the PyQt4 and PyQt4.QtGui namespaces.<br><br>