Python\'s access to environment variables does not accurately reflect the operating system\'s view of the processes environment.
os.getenv and os.environ do not func
You can use ctypes to do this pretty simply:
ctypes
>>> from ctypes import CDLL, c_char_p >>> getenv = CDLL("libc.so.6").getenv >>> getenv.restype = c_char_p >>> getenv("HOME") '/home/glyph'