注:我知道正确的解决方案是做到pip install pywin32
,然后让一切自动完成,但这里的问题是关于pythoncom
的内部 struct .
当达到import pythoncom
英里时,它是有效的,但:
-
在"C:\Python38\Lib\site-packages\pythoncom.py"中,有
import pywintypes
,但no pywintypes.py或.pyd或.dll存在于site-packages
目录中.pywintypes
.如何"神奇"地找到它? -
在进行
print(pythoncom.__file__)
次测试时,我们可以看到:'C:\\Python38\\lib\\site-packages\\pywin32_system32\\pythoncom38.dll'
这种惊人的行为是如何在内部实现的呢?(例如,我们导入的pythoncom.py现在被识别为另一个文件.dll)
-
pythoncom.py
包含:# Magic utility that "redirects" to pythoncomxx.dll import pywintypes pywintypes.__import_pywin32_system_module__("pythoncom", globals())
What and where is this (I quote) "magic utility" that redirects to 100?
我不知道在只执行import pythoncom
次时,这个实用程序在哪里被调用.