I'd like to import a func from another ipython-notebook. Say,
common_func.ipnb
has def func_a()
When I create a new notebook, how can I access the func_a
which is from another notebook but in the same folder and same ipython instance?
I'd like to import a func from another ipython-notebook. Say,
common_func.ipnb
has def func_a()
When I create a new notebook, how can I access the func_a
which is from another notebook but in the same folder and same ipython instance?
When you start ipython use the --script flag: For example
ipython notebook --script
Then whenever you save your notebook "common_func.ipnb" it will also create a file entitled "common_func.py." You can import functions from that by using
from common_func import func_a
If you change the common_func notebook, you may need to use
reload()