Skip to content

Instantly share code, notes, and snippets.

@alvesjnr
Created March 15, 2013 15:16

Revisions

  1. alvesjnr created this gist Mar 15, 2013.
    11 changes: 11 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    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()