On Oct 7, 1:24 am, Scott David Daniels <[EMAIL PROTECTED]> wrote: > goldtech wrote: > > ... I want the new file's location to be on the user's desktop in > > a Windows XP environment.... > > How about: > import os.path > handle = open(os.path.expanduser(r'~\DeskTop\somefile.txt'), 'w') > ...
That doesn't work on my system. "~" uses the HOME environment variable if set, otherwise uses HOMEDRIVE and HOMEPATH which is what I posted before. See Lib/ ntpath.py in a recent source distribution. In my case I set HOME to a path without spaces in it, to simplify my use of Emacs and Cygwin. -- http://mail.python.org/mailman/listinfo/python-list