razpeitia gracias por responder, hice lo que me indicas pero ya obtengo este error
Código BASH:
Ver original# python prueba3.py
Traceback (most recent call last):
File "prueba3.py", line 10, in <module>
raise ValueError('Device not found')
ValueError: Device not found
El codigo que quiero probar es el de la pagina
http://pyusb.sourceforge.net/docs/1.0/tutorial.html
Código Python:
Ver original#coding: utf-8
import usb.core
import usb.util
# find our device
dev = usb.core.find(idVendor=0xfffe, idProduct=0x0001)
# was it found?
if dev is None:
raise ValueError('Device not found')
# set the active configuration. With no arguments, the first
# configuration will be the active one
dev.set_configuration()
# get an endpoint instance
cfg = dev.get_active_configuration()
interface_number = cfg[(0,0)].bInterfaceNumber
alternate_settting = usb.control.get_interface(interface_number)
intf = usb.util.find_descriptor(
cfg, bInterfaceNumber = interface_number,
bAlternateSetting = alternate_setting
)
ep = usb.util.find_descriptor(
intf,
# match the first OUT endpoint
custom_match = \
lambda e: \
usb.util.endpoint_direction(e.bEndpointAddress) == \
usb.util.ENDPOINT_OUT
)
assert ep is not None
# write the data
ep.write('test')