To a environment variable in Windows, can python know if it is a
system environment
variable or a current-user environment variable?
--
--
http://mail.python.org/mailman/listinfo/python-list
could ildg wrote:
To a environment variable in Windows, can python know if it is a
system environment
variable or a current-user environment variable?
Not just by using the os.environ approach.
You would have to resort to the pywin32
extensions. Check the Python Cookbook using
Google for
There is nothing that plainly differentiates whether an environment
variable is the system's or the current user's.
What you could do is:
1. Get the list of environment variables for the user the script is
executing as.
2. Use the pywin32 extensions to access the registry key
HKCU\Environment
3.