mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-24 12:05:22 +08:00
Provide the notebook being imported with "get_ipython"
This commit is contained in:
parent
bceab630e7
commit
4eb755872a
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user