[IPython-dev] Embedding IPython in IEP

Almar Klein a.klein at science-applied.nl
Fri Jan 24 17:13:08 EST 2014


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

Since we already have kernel-IDE communication, debugging, etc.
implemented, using an approach that integrates in a light manner with our
existing framework seemed an easy solution. And until now it seems a pretty
good approach. But I will have a look at the qt module too to see what it
brings extra and what extra work it would entail to integrate it with IEP.

b) I think your users would expect the same IPython behavior as Canopy and
> Spyder offer through it right now.
>

What kind of behavior do you mean?

- Almar






>
>
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 listIPython-dev at scipy.orghttp://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
>


-- 
Almar Klein, PhD
Science Applied
phone: +31 6 19268652
e-mail: a.klein at science-applied.nl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20140124/d766c1c7/attachment.html>


More information about the IPython-dev mailing list