import ctypes.wintypes
def getDocPath(pathID=5):
'''path=5: My Documents'''
buf= ctypes.create_unicode_buffer(ctypes.wintypes.MAX_PATH)
ctypes.windll.shell32.SHGetFolderPathW(None, pathID, None, 0, buf)
return buf.value
for i in range(60):
print(i,getDocPath(i))
print('\nMy Documents\' Path:',end='\n\t')
print(getDocPath())
上一篇
求列表的共有值(交集)
2024-05-08
下一篇
获取桌面路径
2024-05-08