From bf5fb3f5656d4dbae251ad99312f49da4c90b01e 2015-03-30 09:52:25 From: Pietro Battiston Date: 2015-03-30 09:52:25 Subject: [PATCH] Provide the notebook being imported with "get_ipython" --- diff --git a/examples/Notebook/Importing Notebooks.ipynb b/examples/Notebook/Importing Notebooks.ipynb index 7346212..44ae0eb 100644 --- a/examples/Notebook/Importing Notebooks.ipynb +++ b/examples/Notebook/Importing Notebooks.ipynb @@ -39,6 +39,7 @@ }, "outputs": [], "source": [ + "from IPython import get_ipython\n", "from IPython.nbformat import current\n", "from IPython.core.interactiveshell import InteractiveShell" ] @@ -138,6 +139,7 @@ " mod = types.ModuleType(fullname)\n", " mod.__file__ = path\n", " mod.__loader__ = self\n", + " mod.__dict__['get_ipython'] = get_ipython\n", " sys.modules[fullname] = mod\n", " \n", " # extra work to ensure that magics that would affect the user_ns\n",