Reputation: 45251
One can run a Jupyter notebook from another notebook using the %run
magic:
%run my_notebook.ipynb
However, I have the path and name of the notebook I wish to run in a python variable, notebook_name
.
Is it possible to run this notebook using the %run
magic? If not, how else might I run the notebook using its name contained in a str
variable?
Upvotes: 2
Views: 1537
Reputation: 19885
You can use $
to evaluate Python variables for Jupyter magic functions in general, much like in a shell:
%run $notebook_name
Upvotes: 6