<br><br><div class="gmail_quote">On Wed, Jan 11, 2012 at 22:09, Fernando Perez <span dir="ltr"><<a href="mailto:fperez.net@gmail.com">fperez.net@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hey Satra,<br>
<div><div class="h5"><br>
On Tue, Jan 10, 2012 at 12:56 PM, Satrajit Ghosh <<a href="mailto:satra@mit.edu">satra@mit.edu</a>> wrote:<br>
> i'm trying to look into the possibility of embedding ipython into the latest<br>
> version of 3d slicer (<a href="http://slicer.org" target="_blank">slicer.org</a>). slicer is a PythonQt application and they<br>
> bundle their own python interpreter with it.<br>
><br>
> any pointers in the right direction would be much appreciated.<br>
<br>
</div></div>A starting point would be to look at Robert's hack:<br>
<br>
<a href="http://mail.scipy.org/pipermail/ipython-dev/2011-December/008456.html" target="_blank">http://mail.scipy.org/pipermail/ipython-dev/2011-December/008456.html</a><br>
<br>
now, ideally we'd do this correctly, by refactoring the Qt console<br>
code so that it can use a KernelManager that could be either local or<br>
remote, and having a local manager for the in-process cases. With<br>
this done, the terminal (or 'plain' ipython) and console (the new<br>
terminal-based two-process one) clients could also then be cleaned up<br>
to use the exact same architecture.<br></blockquote><div><br></div><div>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:</div>
<div><br></div><div>class MyKernelManager:</div><div> # do whatever special things you need to do</div><div><br></div><div>class MyQtApp(QtConsoleApp):</div><div> kernel_manager_class = MyKernelManager</div><div><br>
</div><div>And you should be done.</div><div><br></div><div>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 <a href="https://github.com/ipython/ipython/pull/1257">trivial PR</a> required to fix this.</div>
<div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
That is the right way to do this and not too much work, but not a tiny<br>
amount of work either. I don't know if right now you have the<br>
bandwidth to try to do it. If you do, I'd be happy to give you a hand<br>
though, so let me know.<br>
<br>
Doing that refactoring is a really important step in finishing up the<br>
architectural clenaup we started with Brian's summer'09 work, so it<br>
would be awesome to tackle it.<br>
<br>
Cheers,<br>
<br>
f<br>
_______________________________________________<br>
IPython-dev mailing list<br>
<a href="mailto:IPython-dev@scipy.org">IPython-dev@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
</blockquote></div><br>