Skip to content

pdyba/myo-python-1

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 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 full absolute path to the Myo SDK to your PATH.
  • Windows: The folder containing myo32.dll and myo64.dll (for example C:\Program Files\Thalmic Labs\myo-sdk-win-0.8.0\bin).
  • Mac: The sdk/myo.framework/ folder. Comment on #10 if you have issues. Try Editing line 105 in lowlevel.py
  • 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

No packages published

Languages

  • Python 56.4%
  • C++ 43.6%