我需要在Python下面的C函數:使用C型在Python
int func(Uint8 *bytRecvBuffer, int *iRecvLen);
我嘗試在Python:
mydll = cdll.LoadLibrary("my.dll")
recvBuffer = None
recvLength = None
funcFunction = getattr(mydll, "func")
funcFunction(POINTER(c_ubyte(recvBuffer)), POINTER(c_int(recvLength)))
錯誤消息:
TypeError: an integer is required
什麼是錯在這裏與參數?
Thx。工作正常! – leon22