[IPython-dev] embedding ipython

Piotr piotr.zolnierczuk at gmail.com
Wed Jan 18 20:45:03 EST 2012


MinRK <benjaminrk <at> gmail.com> writes:

> 
> 
> On Wed, Jan 11, 2012 at 22:09, Fernando Perez <fperez.net <at> gmail.com> 
wrote:
> 
> A starting point would be to look at Robert's 
hack:http://mail.scipy.org/pipermail/ipython-dev/2011-December/008456.html
> 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:
> 
> 
> class MyKernelManager:
>     # do whatever special things you need to do
> 
> class MyQtApp(QtConsoleApp):
>     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 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.
> Cheers,
> f
> _______________________________________________


Is there any way to "preset" fonts and set pylab back-end using this embedded 
ipython example?

I managed to embed IPythonWidget but
a) pylab initializes to Tk (and I need pylab.show() for pop-up)
b) the font is tiny (I can always use Ctrl-+) but that's annoying

Piotr





More information about the IPython-dev mailing list