I'll use python 3.8.
I'm using MacOS 10.15 and as the iohidmanager backend
It works like this.
>>> import hid
>>> hidraw = hid.Device(0x2341, 0x8036)
>>> hidraw.close()
However, if you just pull usb and call hidraw = hid.Device(0x2341, 0x8036) again, an error will appear:
>>> hidraw = hid.Device(0x2341, 0x8036).
Traceback (most recent call last):
File "<stdin>", line 1, in <module>.
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/hid/__init__.py", line 130, in __init__.
raise HIDException('unable to open device')
hid.HIDException: unable to open device
Once the python is restarted, it's back to normal.
I'll use python 3.8.
I'm using MacOS 10.15 and as the iohidmanager backend
It works like this.
However, if you just pull usb and call hidraw = hid.Device(0x2341, 0x8036) again, an error will appear:
Once the python is restarted, it's back to normal.