Summary
The %run
magic provided by IPython not only supports the execution of regular Python scripts, it also runs Jupyter Notebook files (.ipynb).
Example
The run_demo.ipynb
notebook below uses %run
to execute all of the cells in reusable_stuff.ipynb
. Once it does, both globals defined in reusable_stuff
are available in run_demo
for use.