jupyter-incubator / contentmanagement

Jupyter Content Management Extensions
Other
78 stars 26 forks source link

Added inject_locals to load_notebook as described in issue #40 #41

Closed post2web closed 8 years ago

post2web commented 8 years ago

You can now do:

from jupyter_cms.loader import load_notebook
module_api = load_notebook('./module_nb.ipynb', inject_locals=dict(a=5))
print module_api.a

Variable 'a' will be in the locals of module_nb.ipynb and can be used with in the code there. This allows us send anything to the loading notebooks before their code is executed.

parente commented 8 years ago

Awesome! 🍰