[IPython-dev] set_next_input() multiple times

Thomas Kluyver takowl at gmail.com
Fri Feb 13 12:30:45 EST 2015

Hi John,

On 13 February 2015 at 08:43, John Omernik <john at omernik.com> wrote:

> I am trying to use set_next_input to add two cells below the cell I am
> executing in.  I can do one cell no problem, but when I do the
> following code, only Hello2 gets added, there is only a single cell.
> How do set two subsequent cells in my currently running notebook (I
> don't want to save off and reopen or anything)

set_next_input() originated with the console interface, where it doesn't
really make sense to set anything beyond the next input. So it can
currently add only one cell per user execution.

If you really need your code to modify the notebook document, you can have
it display javascript to do so - but be careful that that JS doesn't get
rerun every time you open the notebook.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150213/b8872101/attachment.html>

More information about the IPython-dev mailing list