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?
We recommend using Microsoft Edge on Windows 10, or any other modern browser in older versions of Windows. On the screen that opens, click Import. On your computer, navigate to the location of your notebook folder (see Step 1), click to select it, and then click Open to import it.
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()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With