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
You can use pywin32 extensions to access the Win32 API. With use of Win32 API you can get the virtual folder that represents the My Documents desktop item.
from win32com.shell import shell, shellcon
doc_folder = shell.SHGetFolderPath(0, shellcon.CSIDL_PERSONAL, None, 0)
Here you can find the description of CSIDL_PERSONAL: https://docs.microsoft.com/en-us/windows/win32/shell/csidl