Skip to content

Instantly share code, notes, and snippets.

@chi-feng
Created May 10, 2022 09:46
Show Gist options
  • Save chi-feng/d7d61042ba100dd7db358ced5a1c3a69 to your computer and use it in GitHub Desktop.
Save chi-feng/d7d61042ba100dd7db358ced5a1c3a69 to your computer and use it in GitHub Desktop.
Python Add parent directory to import path
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