Have you tried pyUsb?
Install using:
pip install pyusb
Here a snippet of what you can do:
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))
Here a good tutorial of pyUsb.
For more documentation, use Python interactive mode with dir() and help().
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…