[IPython-dev] embedding ipython
Thu Jan 12 01:09:25 CST 2012
On Wed, Jan 11, 2012 at 22:09, Fernando Perez <firstname.lastname@example.org> wrote:
> Hey Satra,
> On Tue, Jan 10, 2012 at 12:56 PM, Satrajit Ghosh <email@example.com> wrote:
> > i'm trying to look into the possibility of embedding ipython into the
> > version of 3d slicer (slicer.org). slicer is a PythonQt application and
> > bundle their own python interpreter with it.
> > any pointers in the right direction would be much appreciated.
> A starting point would be to look at Robert's hack:
> now, ideally we'd do this correctly, by refactoring the Qt console
> code so that it can use a KernelManager that could be either local or
> remote, and having a local manager for the in-process cases. With
> this done, the terminal (or 'plain' ipython) and console (the new
> terminal-based two-process one) clients could also then be cleaned up
> to use the exact same architecture.
I should note that the QtConsole (and any derivative of of ShellApp) has a
kernel_manager_class, and subclasses can simply change this value to use
different KernelManagers. So as it stands currently, you should be able to
# do whatever special things you need to do
kernel_manager_class = MyKernelManager
And you should be done.
Unfortunately, code used to launch tabs other than the first was *not*
updated to use this, and has QtKernelManager hardcoded instead of using the
attribute. I've opened the trivial
PR<https://github.com/ipython/ipython/pull/1257>required to fix this.
> That is the right way to do this and not too much work, but not a tiny
> amount of work either. I don't know if right now you have the
> bandwidth to try to do it. If you do, I'd be happy to give you a hand
> though, so let me know.
> Doing that refactoring is a really important step in finishing up the
> architectural clenaup we started with Brian's summer'09 work, so it
> would be awesome to tackle it.
> IPython-dev mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-dev