Skip to content

Instantly share code, notes, and snippets.

@paduel
Created December 13, 2019 15:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paduel/2daa781ec2c814b8c2c2bd7b4c065182 to your computer and use it in GitHub Desktop.
Save paduel/2daa781ec2c814b8c2c2bd7b4c065182 to your computer and use it in GitHub Desktop.
Add the current folder to the Python modules path
import sys
import os
for line in sys.path:
if line.endswith('site-packages'):
print(line)
lib_path = line
file = os.path.join(lib_path, 'accurate_modules.pth')
with open(file, 'a') as path_file:
path_file.write(os.getcwd())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment