libfprint 的 Python 包装器
在哪里可以找到 libprint 的 Python 包装器?如果这样的包装器不存在,是否可以编写一个?我该如何开始?
Where can I find a Python wrapper for libprint? If such wrapper does not exist, is it possible to write one? How can I get started?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
由于 libfprint (我希望这是您正在寻找的项目)正在使用 GLib,您可能想要研究GObject Introspection。
As libfprint (I hope it is the project you are looking for) is using GLib, you might want to look into GObject Introspection.
我也为此做了很多搜索,并且在尝试按原样使用 libfprint 时确实学习了很多 C/C++,但有一天,不知从何而来,我看到了 一个问题有人在这里发布,瞧:
https://github.com/luksan/pyfprint
I also made a lot of search for this, and I did learn a lot of C/C++ while trying to use libfprint as it is, but someday, out of nowhere, I saw a question some guy posted here and voilà:
https://github.com/luksan/pyfprint
正如 @plaes 的回答中所述,可以将 Python 中的 libfprint (或 libfprint-2)与 GObject Introspection (GI)结合使用。
您应该安装了正确的软件包。在 Ubuntu 20.04 中,我安装了
python3-gi
:然后您可以从 python3 shell 中使用该库,如下所示:
在 dir 结果中,您将看到可用的导出名称。请参阅 libfprint API 文档了解用法: https://fprint.freedesktop.org/libfprint-dev/< /a>
这是一个简单的入门示例:
请注意,fprintd 还可以使用 D-Bus API:https://fprint.freedesktop.org/fprintd-dev/ref-dbus.html< /a>
As said in the @plaes's answer it's possible to use libfprint (or libfprint-2) from Python with GObject Introspection (GI).
You should have the correct packages installed. In Ubuntu 20.04, I installed
python3-gi
:And then you can use the library like this from the python3 shell:
In the dir result you'll see the exported names available. Refer to libfprint API documentation for usage: https://fprint.freedesktop.org/libfprint-dev/
Here's a simple example to get started:
Note that there is also a D-Bus API available to fprintd: https://fprint.freedesktop.org/fprintd-dev/ref-dbus.html