Suppose there is a Jupyter notebook file named template.ipynb
in the current directory. What I want to do is to load its cells into the current notebook. It's different from the %run
magic command, which executes the code in the notebook file and shows the output, or the %load
magic command, which loads the code into the current cell. I want to load the cells into the current notebook, so that I can edit the code and execute it later. Is there any way to do this?
The reason I look for such capabilities is to allow user to load some preset template into their current notebook by just running a command, for example my_package.load_template('opencv')
and then cells from the preset opencv template will be created in the current notebook.
Is there any magic command, for example, named %load_nb
, which works like %load
, but instead of loading code into the current cell, %load_nb
should load another notebook from local file system or internet into the current notebook.