[Tutor] Problem with environement variables in Windows XP

Alan Gauld alan.gauld at blueyonder.co.uk
Sun Sep 14 14:02:22 EDT 2003


> I'm working under Windows XP, python 2.2.1 and I'm trying to find a
> user's home directory.
> >>> import os.path
> >>> os.path.expanduser('~')
> '%USERPROFILE%'

expanduser works for me both under cygwin and vanilla XP Python.

I'm using 2.3 is the only difference...

Alan G.




More information about the Tutor mailing list