[Tutor] Problem with environement variables in Windows XP

Guillermo Fernandez guillermo.fernandez at epfl.ch
Sun Sep 14 10:48:54 EDT 2003


Hi,

First of all, thanks to all of those who answered me for the
productivity question. I'll try both editors and choose the one who fits
me best :-)

I'm working under Windows XP, python 2.2.1 and I'm trying to find a
user's home directory.
I have this problem when I use the python interpreter:
>>> import os.path
>>> os.path.expanduser('~')
'%USERPROFILE%'
>>> os.path.expandvars(os.path.expanduser('~'))
'%USERPROFILE%'

But when I work with DOS prompt the variable %USERPROFILE% is well
identified:
> echo %USERPROFILE%
C:\Documents and Settings\guille

I had a look to the documentation and I did not find my mistake. What
i'm doing wrong?

Thanks!

Guille









More information about the Tutor mailing list