[IPython-dev] Embedding IPython in IEP

Carlos Córdoba ccordoba12 at gmail.com
Thu Jan 23 22:20:29 EST 2014


Hi Almar,

Just a quick question: why are not you guys using RichIPythonWidget from 
the IPython.qt submodule? I mention it because

a) It seems easier to use in a Qt environment than InteractiveShell.
b) I think your users would expect the same IPython behavior as Canopy 
and Spyder offer through it right now.

Cheers,
Carlos

El 20/01/14 09:14, Almar Klein escribió:
> Hi all,
>
> I am currently working on embedding IPython in IEP (Interactive Editor 
> for Python - http://iep-project.org), and I am interested in getting 
> some feedback.
>
> The approach that I am taking right now is to hook into IPython at a 
> rather low level and integrate it with relatively small changes to the 
> existing code-base for the IEP kernel. It basically comes down to this:
>
> from IPython.core.interactiveshell import InteractiveShell
>
> self._ipython = InteractiveShell(user_module=__main__)
> # set a few hooks ...
> ...
> # When user is sending a line to execute ...
> if self._ipython:
>
> self._ipython.run_cell(source, True)
>
> else:
>
> self._run_cell_natively(source)
>
>
> Apart from this I use custom prompts at sys.ps1 and sys ps2 to 
> simulate the IPython prompts, plus a handfull of small tweaks to make 
> things work as expected.
>
>
> The kernel runs the event loop as usual and arranges for GUI integration.
>
>
> So far things are looking good and everything seems to work as 
> expected. I was mostly wondering whether this approach has any 
> limitations that I overlooked, like some specific IPython feature that 
> is not available with this approach. Also, I would be happy to learn 
> any specific things that I should take into account.
>
>
> Thanks in advance,
>
> Almar
>
>
>
>
>
>
>
>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140123/e74bdb67/attachment.html>


More information about the IPython-dev mailing list