Git Product home page Git Product logo

myo-python's Introduction

Python bindings for the Myo SDK

The Python myo package is a ctypes based wrapper for the Myo shared libraries. Its goal is to give a complete exposure of the Myo SDK as a high level API to Python developers.

Python Myo is compatible with Python 2 and 3!

Example

import myo
myo.init()

from myo.six import print_

class Listener(myo.DeviceListener):

    def on_pair(self, myo, timestamp):
        print_("Hello Myo")

    def on_rssi(self, myo, timestamp, rssi):
        print_("RSSI:", rssi)
        return False # Stop the Hub

def main():
    hub = myo.Hub()
    hub.set_locking_policy(myo.locking_policy.none)
    hub.run(1000, Listener())

if __name__ == '__main__':
    main()

See hello_myo.py for more examples.

Getting Started

  1. Add this folder (the folder containing README.md and myo/) to your PYTHONPATH.
  • command line: export PYTHONPATH=$PYTHONPATH:/path/to/myo-python; or
  • programmatically in your Python module:
import os, sys
sys.path.append(os.path.join('path', 'to', 'myo-python'))
  1. Download the Myo SDK for your system from here.
  2. Add the Myo SDK to your path.
  • Windows: Add the full absolute path of the folder containing myo32.dll and myo64.dll (for example "C:\Program Files\Thalmic Labs\myo-sdk-win-0.8.0\bin" without quotes) to your PATH.
  • Mac: Add the full absolute path for myo.framework/ (for example "/Library/frameworks/myo.framework" without quotes) to DYLD_LIBRARY_PATH. Comment on #10 if you have issues.
  • Linux: Use Unity? Comment on #11 if you figure this out and we'll update the README. People have definitely gotten the Myo SDK to work on Linux and there should be some forum posts about it somewhere.

This project is licensed under the MIT License. Copyright © 2015 Niklas Rosenstein

myo-python's People

Contributors

niklasrosenstein avatar juharris avatar sgzsh269 avatar andybarron avatar cgoodine avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.