expandpath() ?? can python reach out to an external directory on users comp?
Python is able to access the entire file system, except paths that require elevated rights (such as C:\Program files\ and C:\Windows\). It can also access them if you run your it as administrator, but you would usually not want that.

If you want to get the user directory path, use:

from os.path import expanduser
home = expanduser("~")


It also works on Windows. Example result: 'C:\\Users\\CoDEmanX'

Note that the Documents folder is not necessarily called like that, if you really want the actual path, you'll need to do this:

import ctypes.wintypes
CSIDL_PERSONAL= 5       # My Documents
SHGFP_TYPE_CURRENT= 0   # Want current, not default value

buf= ctypes.create_unicode_buffer(ctypes.wintypes.MAX_PATH)
ctypes.windll.shell32.SHGetFolderPathW(0, CSIDL_PERSONAL, 0, SHGFP_TYPE_CURRENT, buf)

print(buf.value)


For me it prints D:\Dokumente, because I set it up this way on my system.