Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reusing code from different IPython notebooks

I am using IPython and want to run functions from one notebook from another (without cutting and pasting them between different notebooks). Is this possible and reasonably easy to do?

like image 276
user7289 Avatar asked Jun 06 '13 15:06

user7289


People also ask

Can I run multiple Jupyter notebooks simultaneously?

Multiple notebooks and kernels In jupyter Lab, you can have multiple notebooks open at the same time and in the same browser window. Also, you can arrange your notebooks as you like which gives more flexibility.

Can you run a Jupyter Notebook from another notebook?

Running a Jupyter Notebook from Another Jupyter NotebookFrom the left Sidebar, select and right-click on the Jupyter notebook that has to be run from another notebook. From the context menu, select Copy Path. Open the Jupyter notebook from which you want to run another notebook. Click Run.

Is IPython notebook and Jupyter Notebook same?

Jupyter Notebook (formerly IPython Notebook) is a web-based interactive computational environment for creating, executing, and visualizing Jupyter notebooks.


1 Answers

Starting your notebook server with:

ipython notebook --script 

will save the notebooks (.ipynb) as Python scripts (.py) as well, and you will be able to import them.

Or have a look at: http://nbviewer.ipython.org/5491090/ that contains 2 notebook, one executing the other.

like image 168
Matt Avatar answered Oct 23 '22 05:10

Matt