Is it possible to distinguish between system environment variables and the user ones?

2005-04-05 Thread could ildg
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

Re: Is it possible to distinguish between system environment variables and the user ones?

2005-04-05 Thread Peter Hansen
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

Re: Is it possible to distinguish between system environment variables and the user ones?

2005-04-05 Thread Kartic
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.