Table of Contents

pyusb: lsusb.py

source

#!/usr/bin/env python
 
import usb
 
for bus in usb.busses():
  for dev in bus.devices:
    print "Bus %s Device %s: ID %04x:%04x %s" % (bus.dirname,dev.filename,dev.idVendor,dev.idProduct,dev.open().getString(1,30))

result

Bus 003 Device 002: ID 0bc7:0006 X10 WTI
Bus 003 Device 001: ID 0000:0000 0000:00:1d.1
Bus 004 Device 002: ID 08ff:2580 Fingerprint Sensor
Bus 004 Device 001: ID 0000:0000 0000:00:1d.2
Bus 002 Device 001: ID 0000:0000 0000:00:1d.0
Bus 005 Device 002: ID 0a5c:2101 Broadcom Corp
Bus 005 Device 001: ID 0000:0000 0000:00:1d.3
Bus 001 Device 001: ID 0000:0000 0000:00:1d.7
 
wiki/projects/python/pyusb/setup/examples/lsusb.txt · Last modified: 2006/06/06 22:52 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki