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

Peter Hansen peter at engcorp.com
Tue Apr 5 09:17:25 EDT 2005


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 "environment variable" recipes and
you'll get a good start on it.

You'll also require a bit of Win32-specific
knowledge, since this entire concept is not
a cross-platform one.

-Peter



More information about the Python-list mailing list