Last active
August 1, 2021 09:22
-
-
Save ZhipengHe/a29171a8ca1802a722d733259d9aaa4d to your computer and use it in GitHub Desktop.
Tips for importing my own python packages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import inspect | |
import os | |
import sys | |
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) | |
parent_dir = os.path.dirname(current_dir) | |
sys.path.insert(0, parent_dir) | |
import my_own_package |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment