text: Hello all,
  A friend and I are attempting to control a robotic hand using python; however, we have been having difficulty with the python code timing out after around 500 frames.
  We have set it up so that the code prints a statement upon connection, prints the data (simply the finger length and width for now, just to get some data imported), and then SHOULD print a statement upon disconnect. Furthermore, our code should run continuously and only exit upon hitting the enter key. However, our code continually exits after a certain amount of time. Even after delaying our frame loop for up to 9 seconds, it continues to only process 500 frames.
  Is this an issue with the buffer? Or, is there potentially a problem with the Leap.py file we downloaded in order to code with the Leap in Python?
  We have posted our current code to this post. We'd appreciate any advice or insight you can provide.
  SAMPLE CODE:
  import Leapimport sys, thread, time
  class LeapMotionListener(Leap.Listener): digit_names = ['Thumb', 'Index', 'Middle', 'Ring', 'Pinky'] bone_names = ['Metacarpal', 'Proximal', 'Intermediate', 'Distal'] state_names = ['STATE_INVALID', 'STATE_START', 'STATE_UPDATE', 'STATE_END']
  def on_init(self, controller):
  print('Initialized')
  def on_connect(self, controller):
  print('Leap Motion connected')
  def on_disconnect(self, controller):
  print('Leap Motion disconnected')
  def on_exit(self, controller):
  print('Exited')
  def on_frame(self, controller):
  frame = controller.frame()
  print "Frame ID: " + str(frame.id)
  for hand in frame.hands:
  for finger in hand.fingers:
  print "Type: " + self.digit_names[finger.type] + " ID: " + str(finger.id) + " Length(mm): " + str(finger.length) + " Width(mm): " + str(finger.width)
  def main(): listener = LeapMotionListener() controller = Leap.Controller()
  controller.add_listener(listener)
  try:
  time.sleep(9)
  print('Yes')
  finally:
  controller.add_listener(listener)
  print('Re-connected')
  if name == "main": main()