Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JupyterLab: Run all cells below

In the Jupyter Notebook I could use the following command to automatically execute all cells below the current cell.

from IPython.display import Javascript
display(Javascript('IPython.notebook.execute_cells_below()'))

However, this doesn't seem to work with JupyterLab. How can I make this work for JupyterLab? (I want to automatically execute all cells below after a button click occured. The original code for this was posted here: IPython - Run all cells below from a widget)

like image 630
Markus Gutbrod Avatar asked Feb 03 '23 21:02

Markus Gutbrod


2 Answers

It is built-in. Click the run menu at the top-left and select "Run Selected Cell and All Below".

enter image description here

like image 87
Francio Rodrigues Avatar answered Feb 06 '23 14:02

Francio Rodrigues


Installing this Jupyter extension in VS-Code, both the commando "Notebook: Execute Cell and Below" and the button in the top-left of each cell are built-in.

The commands can be opened with "CTRL + SHIFT + P".

Commando "Notebook: Execute Cell and Below" jupyter_notebook_execute_cell_and_below_1

Button in the top-left of each cell: jupyter_notebook_execute_cell_and_below_2

like image 36
Andreas L. Avatar answered Feb 06 '23 14:02

Andreas L.