You can get and set environment variables via os.environ :
import os user_home = os.environ["HOME"] os.environ["PYTHONPATH"] = "..."
But since your interpreter is already running, this will have no effect. Better with
import sys sys.path.append("...")
which is an array, your PYTHONPATH will be converted to the beginning of the interpreter.
miku Jun 24 '10 at 8:29 2010-06-24 08:29
source share