PyUSB available for current versions of Windows?

John Nagle nagle at animats.com
Fri Mar 9 12:18:21 EST 2012


    I want to enumerate the available USB devices.  All I really
need is the serial number of the USB devices available to PySerial.
(When you plug in a USB device on Windows, it's assigned the next
available COM port number.  On a reboot, the numbers are reassigned.
So if you have multiple USB serial ports, there's a problem.)

    PyUSB can supposedly do this, but the documentation is misleading.
It makes a big point of being "100% Python", but that's because it's
just glue code to a platform-specific "back end" provided by someone
else.

    There's an old Windows back-end at 
"http://www.craftedge.com/products/libusb.html", but it was written for 
Windows XP, and can supposedly be run in "compatibility mode" on Windows 
Vista. Current versions of Windows, who knows? It's not open source, and 
it comes from someone who sells paper-cutting machines for crafters.

    There's another Windows back end at

	https://sourceforge.net/apps/trac/libusb-win32/wiki

but it involves installing a low-level driver in Windows.
I especially like the instruction "Close all applications which use USB 
devices before installing."  Does this include the keyboard and mouse?
They also warn "The device driver can not be easily removed from the 
system."

					John Nagle



More information about the Python-list mailing list