使用ctypes
python标准中可用的方法,而无需使用pywin32 API。像这样:
from ctypes import *
buf = create_unicode_buffer(260)
GetLongPathName = windll.kernel32.GetLongPathNameW
rv = GetLongPathName(path, buf, 260)
print buf.value
来自http://mail.python.org/pipermail/python- win32/2008-January/006642.html