Jeff Epler <> pisze:
> os.environ holds the system environment, so
> home = os.environ['HOME']
> on unix, and
> home = os.environ['HOMEPATH']
> on windows might be what you want.
>
> You could also try
> home = os.path.expanduser("~")
> which looks at HOME and pwd.getpwuid on unix, and at HOME, HOMEPATH, and
> HOMEDRIVE on NT.
Unfortunately, the latest is known to give strange results on Windows
2000. On my machine at work (W2K Sp3) it just returns string
'%USERPROFILE%'. On my wife's WinXP Pro Sp1 it returns 'C:\', which is
crap, since home directory is set to 'C:\Documents and Settings...'
(that's the value of HOMEDRIVE + HOMEPATH and of USERPROFILE variables).
--
Jarek Zgoda
Registered Linux User #-1
http://www.zgoda.biz/ JID:
http://zgoda.jogger.pl/