Skip to content

Working CPython 3 support (tested with 3.8.10) #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 26, 2021

Conversation

clach04
Copy link
Contributor

@clach04 clach04 commented Aug 26, 2021

Added start of install notes.

Python 3 needs relative paths for import to work.
Updated import order to match pep-8 (system, third party, then custom/local imports).

Demo code that works for me with both CPython 2.7 and 3.8:

"""Display to a HD44780 character LCD connected via PCF8574 on I2C."""

import sys

from lcd.i2c_lcd import I2cLcd  # https://github.com/dhylands/python_lcd

print('Python %r on %r' % (sys.version, sys.platform))

# The PCF8574 has a jumper selectable address: 0x20 - 0x27
DEFAULT_I2C_ADDR = 0x27

lcd = I2cLcd(1, DEFAULT_I2C_ADDR, 2, 16)
#lcd.blink_cursor_on()
#lcd.blink_cursor_off()
lcd.hide_cursor()
d_str = 'The quick brown fox jumps over t'  #
lcd.putstr(d_str)

@dhylands dhylands merged commit 14203df into dhylands:master Aug 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants