[IPython-dev] Embed IPython console into a web-app GUI

Thomas Kluyver takowl at gmail.com
Sat Sep 27 14:34:45 EDT 2014


Hi Adamos,

There are two answers to this:

First, you can embed a terminal emulator in your application, and run plain
terminal IPython. This is what Pythonanywhere and Wakari do. The existing
packages for this that I'm aware of to do this in Python - shellinabox and
GateOne - are GPL and AGPL licensed respectively, so unfortunately we can't
use them in IPython. As it happens, I'm currently working with R. Saravanan
to clean up the BSD-licensed terminal emulator component of his Graphterm
project. This provides a Python backend for the MIT-licensed term.js
Javascript terminal emulator.

If you're interested in this, I'm working on this in a branch here:
https://github.com/takluyver/pyxterm/tree/teardown

The second answer is to actually build a proper web console interface,
reusing pieces from the IPython notebook machinery. This would be more
work, but could provide a much nicer interface, because it's not
constrained by the limitations of the tty interface, which was originally
designed for computers to drive an electronic typewriter. We do want to get
to this, because it would be useful to have such a console available in the
notebook interface.

I hope that's useful - feel free to ask if you have more questions. And
thanks for the link to Muntjac, it looks like an interesting project.

Best wishes,
Thomas

On 27 September 2014 01:33, Adamos Kyriakou <somada141 at gmail.com> wrote:

> Hi all,
>
> I’ve been searching for a while for a way to embed an IPython terminal
> into a web-app GUI, in particular one created with Muntjac
> <http://www.muntiacus.org/> (a pythonic version of Vaadin
> <https://vaadin.com>), but to no avail. While there’s tons of material on how
> to embed it in Qt/wx/Tk
> <http://ipython.org/ipython-doc/stable/interactive/reference.html#embedding> applications
> and the like, I haven’t found a decent solution for a web-app. On the other
> hand I’m confident it’s possible as the guys at PythonAnywhere
> <https://www.pythonanywhere.com/try-ipython/> and Wakari
> <https://www.wakari.io> have pulled it off.
>
> Any ideas on how this could be achieved?
>
> Thanks a bunch!
>
> PS. As you can see this question has been asked a number of times on
> different platforms but without a definitive answer:
>
> http://mail.scipy.org/pipermail/ipython-dev/2013-October/012505.html
>
> http://stackoverflow.com/questions/11264918/how-to-embed-a-python-interpreter-on-a-website
>
> http://stackoverflow.com/questions/17014868/add-an-ipython-console-to-a-webpage
>
> _______________________________________________
> 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/20140927/90d8c72c/attachment.html>


More information about the IPython-dev mailing list