I have this small program and it needs to create a small .txt file in their \'My Documents\' Folder. Here\'s the code I have for that:
textfile=open(\'C:\\Us
Use os.path.expanduser(path), see http://docs.python.org/library/os.path.html
os.path.expanduser(path)
e.g. expanduser('~/filename')
expanduser('~/filename')
This works on both Unix and Windows, according to the docs.
Edit: forward slash due to Sven's comment.