Good morning I'm trying to get the USB stick readers that I have installed on my PC.
but it throws me the following error:
Traceback (most recent call last):
File "C:\Users\Angel\Desktop\pos.py", line 2, in <module>
lectoras = usb.core.find(find_all=True)
File "C:\Users\Angel\AppData\Local\Programs\Python\Python36\lib\site-packages\usb\core.py", line 1263, in find
raise NoBackendError('No backend available')
usb.core.NoBackendError: No backend available
[Finished in 0.8s with exit code 1]
this is my code:
import usb.core
lectoras = usb.core.find(find_all=True)
detected = [usb.util.get_string(lectora,length=17,index=2,langid=0x409)for lectora in lectoras]
print(detected)
complete code:
import usb.core
import usb.backend.libusb1
lectoras = usb.core.find(find_all=True)
detected = [usb.util.get_string(lectora,length=17,index=2,langid=0x409)for lectora in lectoras]
print(detected)
for reader in lectoras:
endpoint = reader[0][(0,0)][0]
readed = False
data = []
datalist =[]
for i in range(22):
data = reader.read(endpoint.bEndpointAdress,endpoint.wMaxPackSize,timeout=1000000)
datalist.append(data)
print(data)