I would like to run a Jupyter notebook from another one changing the outputs inside the notebook running instead of having the outputs printing in the notebook commanding the run.
I know that there is the %run notebook.ipynb command but it displays the outputs inside the notebook with this line and does not change the outputs in the notebook run.

- 680
- 1
- 12
- 24
2 Answers
Not possible the way you ask.
TL;DR
Starting jupyter notebook programmatically from another notebook talk about opening other notebook via command in another tab of browser, but it is not run automatically on open.
If notebook is already opened IMHO your request is not possible to fulfill in way your asked. With %run
the target notebook is running inside your commanding notebook, parameter to %run
is a file. Notebook loaded in other tab of your browser is just some data loaded to browser (actually more complex than that). Suppose you have several tabs with same notebook file open in browser - how you want to choose which one to run?

- 3,423
- 7
- 36
- 71
You can use papermill a package that will allow you to run parameterized notebooks from the CLI or python code
import papermill as pm
pm.execute_notebook(
'path/to/input.ipynb',
'path/to/output.ipynb',
parameters=dict(alpha=0.6, ratio=0.1)
)

- 557
- 9
- 18