Re: Getting the home directory in Python and a bug in os.path.expanduser
- From: Neil Hodgson <nyamatongwe+thunder@xxxxxxxxx>
- Date: Sat, 07 Jul 2007 23:45:22 GMT
Edward Diener:
Probably most reliable on Windows is a Windows API function, if it exists, for getting the home directory, as opposed to using environment variables, but I can not find any Windows API for it at present.
Look at SHGetFolderPath(CSIDL_PROFILE, ...) for Windows Me/2000 or later. CSIDL_APPDATA is probably a better idea than CSIDL_PROFILE (its equivalent to "%USERPROFILE%\Application Data" and roams) but %USERPROFILE% (CSIDL_PROFILE) is compatible with previous Python behaviour.
http://msdn2.microsoft.com/en-us/library/ms647764.aspx
Neil
.
- Follow-Ups:
- Re: Getting the home directory in Python and a bug in os.path.expanduser
- From: Edward Diener
- Re: Getting the home directory in Python and a bug in os.path.expanduser
- References:
- Getting the home directory in Python and a bug in os.path.expanduser
- From: Edward Diener
- Re: Getting the home directory in Python and a bug in os.path.expanduser
- From: Josiah Carlson
- Re: Getting the home directory in Python and a bug in os.path.expanduser
- From: Edward Diener
- Getting the home directory in Python and a bug in os.path.expanduser
- Prev by Date: Re: Restarting a Python Application
- Next by Date: Re: __unicode__ method for exception object
- Previous by thread: Re: Getting the home directory in Python and a bug in os.path.expanduser
- Next by thread: Re: Getting the home directory in Python and a bug in os.path.expanduser
- Index(es):
Relevant Pages
|