@@ -0,0 +1,2760 @@
+import os, sys, time, inspect%0Afrom prettytable import PrettyTable%0A%0A%22%22%22%0A#Environment Setup%0A%0A@src_dir  : file current path%0A@arch_dir : libs path of different architecture%0A@leap_dir : Leap Motion module path%0A%22%22%22%0Asrc_dir = os.path.dirname(inspect.getfile(inspect.currentframe()))%0Aarch_dir = '../../motion-leap/lib/x64' if sys.maxsize %3E 2 ** 32 else '../../motion-leap/lib/x86'%0Aleap_dir = '../../motion-leap/lib'%0Asys.path.insert(0, os.path.abspath(os.path.join(src_dir, arch_dir)))%0Asys.path.insert(0, os.path.abspath(os.path.join(src_dir, leap_dir)))%0Aimport Leap%0A%0A%0Aclass Listener(Leap.Listener):%0A    def on_init(self, controller):%0A        print %22Initialized%22%0A%0A    def on_connect(self, controller):%0A        print %22Connected%22%0A%0A    def on_disconnect(self, controller):%0A        print %22Disconnected%22%0A%0A    def on_exit(self, controller):%0A        print %22Exited%22%0A%0A    def on_frame(self, controller):%0A        frame = controller.frame()%0A        hand = frame.hands.rightmost%0A        interaction_box = frame.interaction_box%0A        palm_position = hand.stabilized_palm_position%0A        normalized_palm = interaction_box.normalize_point(palm_position)%0A        x = normalized_palm.x * 16 - 1%0A        y = (1 - normalized_palm.y) * 9 - 1%0A%0A        print '--------------------------------------------------------------%3Ex:', normalized_palm.x%0A        print '--------------------------------------------------------------%3Ey:', 1 - normalized_palm.y%0A%0A        window = %5B%0A            %5B'-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-'%5D,%0A            %5B'-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-'%5D,%0A            %5B'-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-'%5D,%0A            %5B'-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-'%5D,%0A            %5B'-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-'%5D,%0A            %5B'-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-'%5D,%0A            %5B'-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-'%5D,%0A            %5B'-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-'%5D,%0A            %5B'-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-', '-'%5D%0A        %5D%0A        window%5Bint(y)%5D%5Bint(x)%5D = '+'%0A        for y in window:%0A            print y%0A%0A        time.sleep(0.1)%0A        os.system('clear')%0A%0A%0Adef main():%0A    listener = Listener()%0A    controller = Leap.Controller()%0A    controller.add_listener(listener)%0A%0A    print %22Press Enter to quit...%22%0A    try:%0A        sys.stdin.readline()%0A    except KeyboardInterrupt:%0A        pass%0A    finally:%0A        controller.remove_listener(listener)%0A%0A%0Aif __name__ == %22__main__%22:%0A    main()%0A

Use dataVisual to support data visualization - Environment setup for different architecture - A interaction box to normal 3D data - A 16*9 matrix to format output, set to '+' where the position of palm - Clear console each time