how to "run all cells" by programming in jupyter notebook?

58 views
Skip to first unread message

MuJohnny chan

unread,
Oct 20, 2017, 7:19:51 AM10/20/17
to Project Jupyter
Hi all,

Is it possible to trigger "run all cells" in jupyter notebook via programming a script? In details, I have programmed a python notebook and it could be run by clicking "run all cells". However, I do not want to use the button and instead programming is preferred.  Then how to do? Is there any REST API for jupyter to run all cells? Any suggestions would be highly appreciated!


best,

johnny

M Pacer

unread,
Oct 20, 2017, 12:18:41 PM10/20/17
to jup...@googlegroups.com
You could use

jupyter nbconvert <name of notebook> --to notebook --execute --in-place

But that can lead to weird behaviour if that is a command inside the notebook itself. Because when it runs all cells it runs that cell which causes it to run all cells again and again forever.

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+u...@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/8610db86-8caa-4132-ad1e-c4625900806d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Paul Hobson

unread,
Oct 20, 2017, 12:39:01 PM10/20/17
to jup...@googlegroups.com

On Fri, Oct 20, 2017 at 9:18 AM, M Pacer <mpa...@berkeley.edu> wrote:
You could use

jupyter nbconvert <name of notebook> --to notebook --execute --in-place

But that can lead to weird behaviour if that is a command inside the notebook itself. Because when it runs all cells it runs that cell which causes it to run all cells again and again forever.
On Fri, Oct 20, 2017 at 04:19 MuJohnny chan <chenm...@gmail.com> wrote:
Hi all,

Is it possible to trigger "run all cells" in jupyter notebook via programming a script? In details, I have programmed a python notebook and it could be run by clicking "run all cells". However, I do not want to use the button and instead programming is preferred.  Then how to do? Is there any REST API for jupyter to run all cells? Any suggestions would be highly appreciated!


best,

johnny

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+unsubscribe@googlegroups.com.

To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/8610db86-8caa-4132-ad1e-c4625900806d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+unsubscribe@googlegroups.com.

To post to this group, send email to jup...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages