How to get user home directory on Windows

Giampaolo Rodola' gnewsg at gmail.com
Sat Jan 12 11:31:59 EST 2008


Hi all,
I'm trying to use the pywin32 extension to find out the user's home
directory but currently I didn't find a solution yet.
What I'd need to do is not getting the home directory of the currently
logged in user but something like:

>>> get_homedir("frank")
"C:\home\users\frank"
>>> get_homedir("josh")
"C:\home\users\josh"

Is there a way to do that?
I tried to search through the Pywin32 documentation with no luck.
In addition I'm not practiced with the Windows API at all.



More information about the Python-list mailing list