[IPython-User] ipython 0.12 + wx

Robert Cimrman cimrman3@ntc.zcu...
Wed Jan 18 15:38:06 CST 2012


On 01/18/2012 10:15 PM, Thomas Kluyver wrote:
> CCing the IPython user list back in so this conversation is visible.
>
> On 18 January 2012 21:14, Thomas Kluyver<takowl@gmail.com>  wrote:
>
>> On 18 January 2012 21:11, Robert Cimrman<cimrman3@ntc.zcu.cz>  wrote:
>>
>>> The only reason why wx threading is needed is that without it mayavi
>>> windows block the shell.
>>
>>
>> That's what that example is about - letting wx GUIs run without blocking
>> the shell. Note that we no longer use threading - it's now cleverly
>> integrated with the wx event loop. Someone on the bug report I linked to
>> now reports that it is working again, so give it a shot.
>>
>> Note that that example is for 0.11+: the code for 0.10.x will be quite
>> different.

I see! The relevant part is just the very bottom. The following code 
works for me with 0.12:

from IPython.frontend.terminal import ipapp
# use an app to parse the command line, and init config
app = ipapp.TerminalIPythonApp()
# don't draw IPython banner during initialization:
app.display_banner = False
app.initialize(argv)
ip = app.shell

if is_wx:
     import wx
     from IPython.lib.inputhook import enable_wx
     wxapp = wx.GetApp()
     enable_wx(wxapp)

Though I cannot say why it works :)

Any idea how to make the same thing in 0.10.x after the following line?

ip = IPython.Shell.make_IPython(argv)

many thanks!
r.


More information about the IPython-User mailing list