Created
September 13, 2013 06:50
-
-
Save jimmycuadra/6547407 to your computer and use it in GitHub Desktop.
Add the current package's dir to sys.path if the file is being run directly.
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 | |
if __name__ == '__main__': | |
package_path = os.path.abspath(os.path.join(__file__, '..', '..')) | |
sys.path.insert(0, package_path) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment