Skip to content

Instantly share code, notes, and snippets.

@stuaxo
Created July 11, 2015 16:22
Show Gist options
  • Select an option

  • Save stuaxo/12864313d8cf1310079e to your computer and use it in GitHub Desktop.

Select an option

Save stuaxo/12864313d8cf1310079e to your computer and use it in GitHub Desktop.
Get orig prefx in virtualenv
def get_orig_prefix():
"""
read orig-prefix.txt and return it
"""
orig_prefix_txt = normpath(abspath(join(get_python_lib(), '..', 'orig-prefix.txt')))
print orig_prefix_txt
try:
with open(orig_prefix_txt) as f:
path = f.readline().strip()
return path
except:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment