Skip to content

Instantly share code, notes, and snippets.

@fsouza
Created October 24, 2011 23:15
Show Gist options
  • Save fsouza/1310699 to your computer and use it in GitHub Desktop.
Save fsouza/1310699 to your computer and use it in GitHub Desktop.
Adding the parent directory to the path with Python
import os
import sys
my_dir = os.path.dirname(__file__)
parent_dir = os.path.abspath(os.path.join(MY_DIR, '..'))
sys.path.append(parent_dir)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment