[IPython-dev] Execute python code from the notebook dashboard

Clyde Fare clyde.fare at gmail.com
Thu May 8 09:32:00 EDT 2014


Hi,

Thanks for the suggestions. I can see that I can start a new kernel by
posting to /api/kernels, but am a little lost at how to pass code to it
using javascript. Is there a simple way to use
services/kernels/js/kernel.js and hence kernel.execute? Or would I need to
explicitly code up connecting to the kernel's ports and passing it the
relevant messages as if I were writing a new kernel?

Cheers

Clyde


On 7 May 2014 10:59, Matthias BUSSONNIER <bussonniermatthias at gmail.com>wrote:

>
> Le 3 mai 2014 à 17:00, Clyde Fare a écrit :
>
> Hi,
>
> I'm trying to create a graphical IPython notebook dashboard that
> represents a collection of notebooks as a network, where nodes are the
> notebooks and the links between them are links between notebooks specified
> in markdown cells.
>
> I've got something that kind of works (
> https://github.com/Clyde-fare/ipython_graphdash) but it requires manual
> execution of some python code in the directory that IPython is launched
> from. I'd like to get rid of this requirement by having this python code
> execute when people click the refresh notebook list icon on the dashboard.
>
> I'm very much a beginner javascript wise but as far as I can tell when we
> open a notebook a python kernel is launched but at the dashboard there is
> no kernel active and so in order to execute some python code I would have
> to first launch a kernel and then pass it the code I want to run. I think I
> can probably go away and figure out how to do that but I wanted to check
> whether this was the right idea, or whether there was a simpler way?
>
>
> In IPython 2.0  you can access the list of notebook and kernels using the
> rest API under /api/*
> https://localhost:8888/api/notebooks
> https://localhost:8888/api/kernels
>> So you can start notebook-less kernel to do whatever you like, and stop it
> afterward.
> You can also get notebook content through this way.
>
> So I would suggest building an alternative dashboard the use this API
>
> --
> M
>
>
> Cheers
>
> Clyde
>
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
>
>
> _______________________________________________
> 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/20140508/b79f5b74/attachment.html>


More information about the IPython-dev mailing list