2014-09-07 22:40 GMT-03:00 Setia Budi <boedy.b...@gmail.com>: > Dear all, > I have further question regarding the use of multiple identical usb reader. > > For example I have two physical USB port on my computer, let's call them > usb1 and usb2. > Then I attach two identical usb device to them. Let's call them device1 and > device2. > > Then I write this Python script > devices = tuple(usb.core.find(find_all=True, idVendor=0x1, idProduct=0x2)) > > My question is, how to make sure that devices[0] is always refer to the usb > device which is connected to usb1 and device[1] is always refer to the usb > device attach to usb2. > I found that there is no consistency every time I call this function: > usb.core.find(find_all=True, idVendor=0x1, idProduct=0x2) > > Anyone could assist me? Thank you :) >
If your device has a serial number, you can order the list using that as the key, so devices will always have the same order. ------------------------------------------------------------------------------ Want excitement? Manually upgrade your production database. When you want reliability, choose Perforce Perforce version control. Predictably reliable. http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk _______________________________________________ pyusb-users mailing list pyusb-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pyusb-users