|
发表于 2021-2-28 11:21:48
|
显示全部楼层
湖北省武汉市
尝试在Python中调用DLL成功,但无法成功返回数值
环境:Python32 3.8.5
- import os
- from ctypes import *
- path = os.getcwd()
- dll = cdll.LoadLibrary(path+"\ocr.dll")
- dll.init()
- img_list =os.listdir(path+"\captcha")
- for i in img_list:
- with open(path+"\captcha\{0}".format(i),"rb") as file:
- image = file.read()
- ocr = dll.ocr(image,len(image))
- print(f"识别返回:{ocr},类型:{type(ocr)},ID地址:{id(ocr)}")
复制代码
易语言中识别成功 rmm4
Python中实际测试为:
识别返回:260632704,类型:<class 'int'>,ID地址:61495456
经测初步测试并非数据类型问题,想请问各位大佬有没有处理方法 |
|