smarthall / python-lifx-sdk

An SDK for local LAN control of bulbs, using Python
MIT License
27 stars 9 forks source link

readline #4

Closed frakman1 closed 9 years ago

frakman1 commented 9 years ago

I tried using the console package on a windows machine and the readline import failed as such:

c:\Python27\python-lifx-sdk-master\python-lifx-sdk-master\examples>python console.py Traceback (most recent call last): File "console.py", line 1, in <module> import pyreadline ImportError: No module named pyreadline No attempts to install or compile it worked as it is not meant to run on Windows. I was however, able to get pyreadline and use that instead. May I suggest you use this form instead:

try:
  import readline
except ImportError:
  import pyreadline as readline
smarthall commented 9 years ago

The code works without readline so I've made it do the following:

  1. Try to import readline
  2. Try to import pyreadline
  3. Start the console without readline support

Changes are in be9ee73e07ddc67f86d00090ad44a9042645a2c3