Created
March 15, 2013 15:16
-
-
Save alvesjnr/5170573 to your computer and use it in GitHub Desktop.
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
def _get_pythonpath(self): | |
if os.name == 'nt': | |
p = subprocess.Popen(["set",], shell=True, stdout=subprocess.PIPE) | |
out, err = p.communicate() | |
for line in out.split(): | |
if line.startswith("PYTHONPATH"): | |
return line.split()[1] | |
else: | |
p = subprocess.Popen(["echo", "$PYTHONPATH"], shell=True, stdout=subprocess.PIPE) | |
out, err = p.communicate() | |
return out.strip() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment