Skip to content

Latest commit

 

History

History
36 lines (27 loc) · 623 Bytes

README.md

File metadata and controls

36 lines (27 loc) · 623 Bytes

nbimporter

Import IPython Notebooks as modules (with Jupyter v4).

Updated from module collated here:

Origin

This is a modified version of code originally collated from https://github.com/adrn/ipython/blob/master/examples/Notebook/Importing%20Notebooks.ipynb Check out that notebook for full documentation and to understand the backgrounds.

Installation

pip install nbimporter

Usage

Notebook foo.ipynb:

In[1]:

def a(): 
    print("Hello World!")

Notebook bar.ipynb:

In[1]:

import nbimporter
from foo import a #import from notebook

a()

Out[1]:

Hello World!