Telling Python to save a .txt file to a certain directory on Windows and Mac
Just use an absolute path when opening the filehandle for writing. You could optionally combine this with os.path.abspath() as described in Bryan’s answer to automatically get the path of a user’s Documents folder. Cheers!