지금까지 나는 그것과 함께 작동하는 Python을위한 것이 아니라는 DLL을 얻었다. 그리고 타입 반환 : 나는 잘못하고 있기 때문에 인수를 전달할 수 없다. 그리고 나는 문서를 이해하지 못한다. 내가 어떻게해야하는지에 관해서. 기본적으로, 내가 테스트하고있는 DLL의 함수 이름은 "iptouint"입니다. c_char_p를 취하여 c_double을 반환합니다. 여기 파이썬 ctypes 던지고 오류?
내 코드입니다 :nDll = ctypes.WinDLL('ndll.dll')
nDllProto = ctypes.WINFUNCTYPE(ctypes.c_double)
nDllInit = nDllProto(("dllInit", nDll))
nDllTestProto = ctypes.WINFUNCTYPE(ctypes.c_double,ctypes.c_char_p)
nDllTest = nDllTestProto(("iptouint",nDll),((1, "p1",0),(1, "p2",0)))
#This is the line that throws the error:
print("IP: %s" % nDllTest("12.345.67.890"))
'''
It gives me the error:
ValueError: paramflags must have the same length as argtypes
Im not sure what to do; Ive certainly played around with it to no avail.
Help is much appreciated.
Thanks.
'''
"ndll"dll에서 실제로 호출 할 함수의 이름과 C 문서를 기술하십시오. – jsbueno
@jsbueno 내가 말했듯이이 함수의 이름은 "iptouint"이며 double을 취하여 문자열을 반환합니다. – pajm