On Jan 18, 2008 3:19 PM, Daniel Folkes <[EMAIL PROTECTED]> wrote: > I am trying to write a file to the users file system. > > I need it to be in there home directory in WINDOWS. I know there is a > "shortcut" to home in Linux("~"), but is there an equivalent to that > in windows. Or to get to their "Documents and Settings" directory?
The easiest way is os.path.expanduser('~') That works on both unix and windows. It gets you the user's home directory on unix, and on windows I think it is based on the environment variables %HOMEDRIVE% and %HOMEPATH%. If that doesn't give you what you're looking for, you'll need to look into the environment variables, the registry, or windows system calls, depending on exactly what you need. -- Jerry -- http://mail.python.org/mailman/listinfo/python-list