sensel-api icon indicating copy to clipboard operation
sensel-api copied to clipboard

Update Python examples to support Python 2 and 3

Open panathea opened this issue 8 years ago • 0 comments

I've updated the Python examples to work with both python 2 and 3. This required a few minor changes:

  • Using "input" in Python 3, and including an import that renames "raw_input" for Python 2.
  • Importing the print function from __future__ which makes print behave like in Python 3.

I also applied some minor PEP8 formatting changes, which includes:

  • Removing unnecessary brackets
  • Reordering imports
  • Changing all strings to single quotes

There were a few other really minor changes along the way. If you have any questions about the code, I'd be happy to explain anything. I tested this with my Sensel Morph on the Mac's built-in python (2.7.10) as well as 3.6.

panathea avatar Nov 17 '17 04:11 panathea