public
Created

Add the current package's dir to sys.path if the file is being run directly.

  • Download Gist
cli.py
Python
1 2 3 4 5 6
import sys
import os
 
if __name__ == '__main__':
package_path = os.path.abspath(os.path.join(__file__, '..', '..'))
sys.path.insert(0, package_path)

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.