Created
May 10, 2022 09:46
-
-
Save chi-feng/d7d61042ba100dd7db358ced5a1c3a69 to your computer and use it in GitHub Desktop.
Python Add parent directory to import path
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 sys | |
import os | |
# add parent directory to import path | |
current = os.path.dirname(os.path.realpath(__file__)) | |
parent = os.path.dirname(current) | |
sys.path.append(parent) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment