Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bf5fb3f

Browse files
committed
Provide the notebook being imported with "get_ipython"
1 parent 6c367e1 commit bf5fb3f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

examples/Notebook/Importing Notebooks.ipynb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
},
4040
"outputs": [],
4141
"source": [
42+
"from IPython import get_ipython\n",
4243
"from IPython.nbformat import current\n",
4344
"from IPython.core.interactiveshell import InteractiveShell"
4445
]
@@ -138,6 +139,7 @@
138139
" mod = types.ModuleType(fullname)\n",
139140
" mod.__file__ = path\n",
140141
" mod.__loader__ = self\n",
142+
" mod.__dict__['get_ipython'] = get_ipython\n",
141143
" sys.modules[fullname] = mod\n",
142144
" \n",
143145
" # extra work to ensure that magics that would affect the user_ns\n",

0 commit comments

Comments
 (0)