title: Raw data from USB in Python with pywinusb
body: <pre><code>import pywinusb.hid as hid
  from time import sleep
  from msvcrt import kbhit
  
  
  def take_data():
      all_hids = hid.find_all_hid_devices()
      int_option = 6
      device = all_hids[int_option-1]
      try:
          device.open()
          #set custom raw data handler
          device.set_raw_data_handler(print)
          print(&quot;\nWaiting for data...\nPress any (system keyboard) key to stop...&quot;)
          while not kbhit() and device.is_plugged():
              #just keep the device opened to receive events
              sleep(0.5)
              return
      except Exception as e:
          print(&quot;error&quot;)
      finally:
          device.close()
  take_data()
  </code></pre>
  <p>I've tried this code from the examples on the github page, but it doesn't seem to do anything. The code runs, but nothing ever gets printed</p>