Finding user's home dir

Nemesis nemesis at nowhere.invalid
Thu Feb 3 15:26:38 EST 2005


Mentre io pensavo ad una intro simpatica "Miki Tebeka" scriveva:

>> Hi all, I'm trying to write a multiplatform function that tries to
>> return the actual user home directory.
>> ...
> What's wrong with:
>     from user import home
> which does about what your code does.

On my Win2000 box it returns "%USERPROFILE%". That's no surprise because
if you look at the code it try to use os.environ["HOME"] (as
os.path.expanduser() does). And on my Win2000 system this information
points to "%USERPROFILE%" field (I don't know why, I'm not the
administrator of that machine).

-- 
Reality is for people who can't face science fiction.
 
 |\ |       |HomePage   : http://nem01.altervista.org
 | \|emesis |XPN (my nr): http://xpn.altervista.org




More information about the Python-list mailing list