我是 python 的新手,现在在 python 中导入 dll 时遇到问题。通过参考网上找到的一些提示,我尝试使用下面的 ctypes 并出现错误提示。
>>> import ctypes
>>> dl=ctypes.WinDll('C:\\Python27\\Lib\\site-packages\\UdfManagerPython.dll')
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
dl=ctypes.WinDll('C:\\Python27\\Lib\\site-packages\\UdfManagerPython.dll')
AttributeError: 'module' object has no attribute 'WinDll'
>>> dl=ctypes.cdll.LoadLibrary('C:\\Python27\\Lib\\site-packages\\UdfManagerPython.dll')
Traceback (most recent call last):
File "<pyshell#3>", line 1, in <module>
dl=ctypes.cdll.LoadLibrary('C:\\Python27\\Lib\\site-packages\\UdfManagerPython.dll')
File "C:\Python27\lib\ctypes\__init__.py", line 431, in LoadLibrary
return self._dlltype(name)
File "C:\Python27\lib\ctypes\__init__.py", line 353, in __init__
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126]
我做错了什么还是这个 dll 没有按照 python 标准编写脚本?我已上传到MediaFire供您分析。非常感谢任何帮助!