第一次使用 PyUSB,试图对 OS X 的眼睛玩具(Play Station)进行逆向工程。虽然在尝试建立测试集合时出现以下错误。
Traceback (most recent call last):
File "eye.py", line 5, in <module>
dev = usb.core.find(0x054C,0x0155)
File "/Library/Python/2.7/site-packages/usb/core.py", line 824, in find
return [d for d in device_iter(k, v)]
File "/Library/Python/2.7/site-packages/usb/core.py", line 794, in device_iter
for dev in backend.enumerate_devices():
AttributeError: 'int' object has no attribute 'enumerate_devices'
当前代码...
import usb.core, time, usb
dev = usb.core.find(0x054C,0x0155)
if dev is None:
raise ValueError('Device not found') # if device not found report an error