[IPython-dev] Embedding IPython in IEP

Fernando Perez fperez.net at gmail.com
Mon Jan 20 20:52:27 EST 2014


Hi Almar,

I would mostly recommend touching bases with the Spyder team, which is the
closest project to yours (Qt- based, IDE-like) that embeds IPython. They
may have learned some additional worthwhile lessons.

Cheers

f


On Mon, Jan 20, 2014 at 6:14 AM, Almar Klein <a.klein at science-applied.nl>wrote:

> 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
>
>


-- 
Fernando Perez (@fperez_org; http://fperez.org)
fperez.net-at-gmail: mailing lists only (I ignore this when swamped!)
fernando.perez-at-berkeley: contact me here for any direct mail
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140120/49fe42f3/attachment.html>


More information about the IPython-dev mailing list