romilly / quick2wire-python-api

Python API for controlling GPIO and I2C devices connected to the Raspberry Pi
Other
290 stars 103 forks source link

API supports both Python 2.7 and Python 3.2 #38

Open npryce opened 11 years ago

dhuntley1023 commented 10 years ago

Is there something technically preventing operation of the API in Python 2.7 (i.e. certain Python features only avail in P3), or is this just a developer preference?

FWIW, I also think it'd be useful to remove the Python 3 dependency, and if it's just a case of needing a bit of work I might take it on and send you a pull... but I'd rather know ahead of time if the pull would be rejected on philosophical grounds.

(Nice lib by the way, was only way to get my Honeywell I2C Pressure Sensor working. SMbus didn't fill the bill)

npryce commented 10 years ago

Hi. I'm glad you found it useful.

We chose Python 3 because we were building our products at education and for people who were learning programming for the first time. Python 3 removes a lot of historical cruft and wierdness from Python 2. E.g. Python 2 has two kinds of class system ("old" and "new" style classes) and some things silently stop working if you accidentally write an old style class by forgetting to make your class extend object. Python 3 has a single class system. Also, Python 3 makes a clear distinction between buffers of bytes and strings of (unicode) text, which makes writing I/O code that interfaces with hardware less error prone.

But, the Quick2Wire libraries are no longer under active development by the original team, so feel free to fork the library and make it do what you want.

All the best, --Nat

On 9 May 2014 07:33, David Huntley notifications@github.com wrote:

Is there something technically preventing operation of the API in Python 2.7 (i.e. certain Python features only avail in P3), or is this just a developer preference?

FWIW, I also think it'd be useful to remove the Python 3 dependency, and if it's just a case of needing a bit of work I might take it on and send you a pull... but I'd rather know ahead of time if the pull would be rejected on philosophical grounds.

(Nice lib by the way, was only way to get my Honeywell I2C Pressure Sensor working. SMbus didn't fill the bill)

— Reply to this email directly or view it on GitHubhttps://github.com/quick2wire/quick2wire-python-api/issues/38#issuecomment-42637481 .