Hi Everyone,
I'm using the Leap motion V2.3.1 Python SDK on linux.
I am running the following code below
import os, sys, inspect, thread, time
src_dir = os.path.dirname(inspect.getfile(inspect.currentframe()))
Windows and Linux
arch_dir = '../lib/x64' if sys.maxsize > 2**32 else '../lib/x86'
Mac
arch_dir = os.path.abspath(os.path.join(src_dir, '../lib'))
sys.path.insert(0, os.path.abspath(os.path.join(src_dir, arch_dir)))
import Leap
def on_frame(self, controller):
frame = controller.frame()
print "Frame id: %d, timestamp: %d, hands: %d, fingers: %d" % (
frame.id, frame.timestamp, len(frame.hands), len(frame.fingers))
class SampleListener(Leap.Listener):
def on_connect(self, controller):
print "Connected"
def on_frame(self, controller):
print "Frame available"
def main():
# Create a sample listener and controller
listener = SampleListener()
controller = Leap.Controller()
# Have the sample listener receive events from the controller
controller.add_listener(listener)
# Keep this process running until Enter is pressed
print "Press Enter to quit..."
try:
sys.stdin.readline()
except KeyboardInterrupt:
pass
finally:
# Remove the sample listener when done
controller.remove_listener(listener)
if name == "main":
main()
But I'm not able to get the finger id , number of fingers etc. outputs on the python shell.
I've attached a screenshot, I only get connected, and the program says to press enter.
Hope you could help me resolve this issues.
Thank you!