I wanted to create my own module with jupyter, what should I do? I will leave a solution.
OS : MacOS Catalina 10.15.5 Machine: 1.2 GHz dual core Intel Core m3 Version : Python 3.7.7
It was difficult to understand what to do with jupyter because the method that came out when I researched various things, so I made a note of the flow from actually creating it with jupyter and executing it.
.py
Now you have created the module.
For importing your own module, please refer to other people's literature.
Modularize and package your own functions with python I'm addicted to importing Python3 self-made modules
import sys, os
from pathlib import Path
#Get the path of a parent directory such as signalfunc,This is a writing style peculiar to Jupyter system
current_dir = os.path.join(Path().resolve())
#Add path with module
sys.path.append(str(current_dir) + '/../make_module')
``
Recommended Posts