[IPython-dev] Embedding IPython in IEP
Carlos Córdoba
ccordoba12 at gmail.com
Sat Feb 1 00:21:31 EST 2014
Hi Almar,
El 24/01/14 17:13, Almar Klein escribió:
>
> 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?
Well, I mean matplotlib inline plots, pretty printing of sympy objects
(using latex or matplotlib), pandas dataframes (using html) and any
other object that uses the rich display IPython system.
Cheers,
Carlos
>
> - 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 list
>> IPython-dev at scipy.org <mailto:IPython-dev at scipy.org>
>> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org <mailto: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 <mailto:a.klein at science-applied.nl>
>
>
> _______________________________________________
> 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/20140201/43ee6d4c/attachment.html>
More information about the IPython-dev
mailing list