Python中的USB接口 [英] USB interface in Python

查看:41
本文介绍了Python中的USB接口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个(http://www.gesytec.de/en/download/easylon/p/16/) USB 设备连接到我的 Win7.我只是想读取供应商 ID 和产品 ID.我有 Python 2.7.

I have this (http://www.gesytec.de/en/download/easylon/p/16/) USB device connected to my Win7. I am just trying to read the vendor ID and product ID. I have Python 2.7.

这是代码,

import usb
busses = usb.busses()
for bus in busses:
    devices = bus.devices
    for dev in devices:
        print "Device:", dev.filename
        print "  idVendor: %d (0x%04x)" % (dev.idVendor, dev.idVendor)
        print "  idProduct: %d (0x%04x)" % (dev.idProduct, dev.idProduct)

我收到以下错误,

"File "<stdin>", line 1, in <module>
File "C:\Python27\lib\usb\core.py", line 846, in find
raise ValueError('No backend available')
ValueError: No backend available"

我在这里做错了什么?

推荐答案

我最终使用了制造商提供的 dll 而不是 USB 库.

I ended up using the dll provided by manufacture instead of USB lib.

这篇关于Python中的USB接口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆