I defined a hello world function in a file called 'functions.ipynb'. Now, I would like to import functions in another file by using "import functions". I am sure that they are in the same folder. However, it still shows that "ImportError: No module named functions". By the way, I am using jupyter notebook. Thanks a lot!
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
You'll want to use the ipynb package/module importer. You'll need to install it:
pip install ipynb
.Create a Notebook named 'MyFunctions'. Add a simple function to it.
Then, create a second Ipython Notebook and import this function with:
Then you can use it as if it was in the same Ipython Notebook:
See the documentation for more details.