rene-aguirre / pywinusb

USB / HID windows helper library
BSD 3-Clause "New" or "Revised" License
207 stars 63 forks source link

How to determine if the device is opened! #40

Closed zhangshengping closed 7 years ago

zhangshengping commented 7 years ago

I use the code below to get a HID device. But I don't whether the device is opened or closed. I try to use HIDDevice.is_opened() to get the status, but it throw a error SyntaxError: invalid syntax. What should I do to get the status of the HID device?


filter = hid.HidDeviceFilter()
all_devices = filter.get_devices()
HIDDevice = all_devices[0]
rene-aguirre commented 7 years ago

HIDDevice matches a pyWinUsb class name.

Please refer to the intro in the wiki and review the examples.