Skip to content Skip to sidebar Skip to footer

Usb Interface In Python

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. Here is the

Solution 1:

Did you install the usb library package? If so you may need to add it to your path.

Solution 2:

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

Solution 3:

currently used library

import usb.core
import usb.backend.libusb0
backend = usb.backend.libusb0.get_backend(find_library=lambda x: "C:\Windows\system32\libusb0.dll")

# find your device #1
devices = usb.core.find(find_all=True)
for d in devices:
    print(d)

# find your device #2import 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))

Post a Comment for "Usb Interface In Python"