2024-05-19 01:13:06 发布
网友
在Python中有一个简单的方法来实现这一点吗?
您可以使用ctypes模块获取“我的文档”目录:
import ctypes from ctypes.wintypes import MAX_PATH dll = ctypes.windll.shell32 buf = ctypes.create_unicode_buffer(MAX_PATH + 1) if dll.SHGetSpecialFolderPathW(None, buf, 0x0005, False): print(buf.value) else: print("Failure!")
来源:http://bugs.python.org/issue1763#msg62242
您可以使用ctypes模块获取“我的文档”目录:
来源:http://bugs.python.org/issue1763#msg62242
相关问题 更多 >
编程相关推荐