Automatically creating a HOME environ variable on Windows?

Jarek Zgoda jzgoda at
Sat Oct 29 11:46:14 CEST 2005

jim.eggleston at napisał(a):

> Windows doesn't have a HOME environment variable, but it does have
> HOMEDRIVE and HOMEPATH. Could Windows versions of Python automatically
> populate os.environ with HOME, where HOME =
> os.path.join(os.environ['HOMEDRIVE'], os.environ['HOMEPATH'])?

MS recommends using %USERPROFILE%, as the above in many cases returns
"C:\", which is wrong.

Jarek Zgoda

More information about the Python-list mailing list