[IPython-dev] API to execute cells of notebook
Paddy Mullen
paddy at paddymullen.com
Thu Aug 7 12:58:01 EDT 2014
Thanks,
I could do that, but it seems a bit out of place in the IPython widget
framework.
Imagine if cells had a hidden attribute that could be set in python. Then
you could use the widget framework to implement a slideshow, or select
which type of report to show. Being able to only access those apis through
javascript raises the bar for use.
On Thu, Aug 7, 2014 at 12:33 PM, Andrew Payne <andy at payne.org> wrote:
>
> I don't see a way via python to cause the current kernel to execute the
>> rest of the cells in the notebook. I could hack something together with
>> javascript, but that seems problematic and brittle.
>>
>
> There are a number of existing Javascript methods for executing cells,
> including execute_cell_range(start, end) and execute_all_cells().
>
> See:
> https://github.com/ipython/ipython/blob/6ecbe721af987d743b7bfcec0448e4edace5f812/IPython/html/static/notebook/js/notebook.js#L1685
>
> And this notebook includes a simple example of adding keyboard shortcut
> using this method. See:
> http://nbviewer.ipython.org/github/minrk/pydata-sv-14/blob/master/What's%20New.ipynb
>
> It's easy to generalize that to a Javascript button.
>
> -andy
>
>
> _______________________________________________
> 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/20140807/d6ab1e65/attachment.html>
More information about the IPython-dev
mailing list