[IPython-user] threaded ipython shell

Fernando Perez Fernando.Perez@berkeley....
Fri May 8 14:02:58 CDT 2009


Hi Robert,

2009/5/6 Robert Cimrman <cimrman3@ntc.zcu.cz>:
> Hi Fernando,
>
> sorry to bother you personally, but I got no answer to [1], and am curious
> what you think about it. Simple answer like "no, it is not possible" will do
> perfectly. :-) It's not a top priority issue for me right now, but I would
> like to know whether to struggle in that direction or not...

No worries, I've been terrible at keeping up with public email due to
a massive set of grant deadlines over the last few weeks, sorry about
that.

> ----
> [1] [IPython-user] how to run threaded ipython shell via API?, from
> 29.04.2009:
>
> Hi,
>
> I am playing with a customized ipython shell a la isympy, which I have
> taken as a start. I have tweaked it into what I call isfepy and it runs
> pretty well, for example:
>
> In [1]: pb, vec, data = pde_solve('input/poisson.py')
> In [2]: view = Viewer(pb.get_output_name())
> In [3]: view()
>
> [1] solves a Poisson equation in 3D by the finite elements, [2]
> constructs a mayavi2 viewer, and [3] displays the results using the
> mayavi's mlab.show()
>
> Now back to the subject - is it possible to make view() non-blocking?
> Currently the shell waits till the mayavi2 window is closed.
>
> I have tried running './isfepy -- -pylab' and similar options (-*thread)
> which were passed into IPython.Shell.make_IPython(), but it did not do
> what I had expected: there were no matplotlib symbols imported, and both
> pylab.show(), and mlab.show() blocked. The same holds for isympy by the way.
>
> thanks for ipython, cheers!
> Robert Cimrman
>
> PS: to try it (not easy yet!), do:
> $ git clone git://github.com/rc/sfepy.git
> $ cd sfepy
> $ git checkout -b isfepy origin/isfepy

This is pretty easy to do:

#!/usr/bin/env python
"""Simple customized ipython that specifically loads WX thread support"""

# Shell class options (the last one is plain, unthreaded ipython):
# IPShellGTK, IPShellWX, IPShellQt, IPShellQt4, IPShell

from IPython.Shell import IPShellWX

# Main
banner ="Welcome to the SFEPy IPython-based shell with Wx support!\n"

ipwx = IPShellWX()
ipwx.mainloop(banner=banner)


### EOF

I hope this helps,

f


More information about the IPython-user mailing list