Skip to content

Msjo/myo-python

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

# Copyright (C) 2014  Niklas Rosenstein
# All rights reserved.

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.

Copyright (C) 2014 Niklas Rosenstein, All rights reserved.

About

Python bindings for the Myo SDK

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 56.9%
  • C++ 43.1%