Create a gist now

Instantly share code, notes, and snippets.

Add the current package's dir to sys.path if the file is being run directly.
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