Windows IR 设备 USB 列表

问题描述 投票:0回答:0

我有红外框,其作用类似于我的电脑中的鼠标输入。当我使用第三方程序时,我可以看到 USB 列表中的设备: enter image description here

但我想用 Python 列出该 USB 设备。我曾经使用过该代码,但它不起作用:


import usb
for dev in usb.core.find(find_all=True):
    print(dev)
    print("Device:", dev.filename)
    print("  idVendor: %d (%s)" % (dev.idVendor, hex(dev.idVendor)))
    print("  idProduct: %d (%s)" % (dev.)

如何在我的 python 中列出该设备?

import usb
for dev in usb.core.find(find_all=True):
    print(dev)
    print("Device:", dev.filename)
    print("  idVendor: %d (%s)" % (dev.idVendor, hex(dev.idVendor)))
    print("  idProduct: %d (%s)" % (dev.)
python serial-port usb hid
© www.soinside.com 2019 - 2024. All rights reserved.