使用ctypes在Python中调用libfprint函数

2024-07-08 10:32:39 发布

您现在位置:Python中文网/ 问答频道 /正文

我需要帮助来调用一个检测设备的函数(Struct C),所以我是这样调用函数的:

from ctypes import *
fp = CDLL('./libfprint.so.0')
fp.fp_discover_devs.argtypes = None
fp.fp_discover_devs.restype = c_char_p
ret = fp.fp_discover_devs()
print ret # is "0" 

没有检测到任何设备,因为返回值是“0”。在

请参阅功能文档:

^{pr2}$

我用的是Ubuntu,我下载了“fprint_demo”,运行得很好。你安装的软件包丢失了吗?在

谢谢。在


Tags: 函数fromimportnonectypesstructdiscover调用函数

热门问题