我想加載與ctypes的dll窗體python代碼,它引發了一個錯誤。無法加載dll python與ctypes
我的Python代碼:
import ctypes
from ctypes import *
hllDll = ctypes.WinDLL ("c:\\Users\\saar\\Desktop\\pythonTest\\check.dll")
,這引發錯誤:
Traceback (most recent call last):
File "C:\AI\PythonProject\check.py", line 5, in <module>
hllDll = ctypes.WinDLL("c:\\Users\\saar\\Desktop\\pythonTest\\check.dll")
File "C:\Python27\lib\ctypes\__init__.py", line 365, in __init__
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126] The specified module could not be found
我谷歌它和每一個崗位,我看到的指南以兩個反斜槓寫dll路徑, 或導入ctypes然後寫入:從ctypes import *。
這個線程你也許有用: http://stackoverflow.com/questions/7586504/ python-access-dll-using-ctypes – West