I set an environment variable that I want to access in my Python application. How do I get its value?
As for the environment variables:
import os print os.environ["HOME"]
I'm afraid you'd have to flesh out your second point a little bit more before a decent answer is possible.