upgrade to Python 3 issues
Closed this issue · 3 comments
dolomitejunkie commented
been using this code to drive a display for Moode Audio. It's been rock solid thank you.
the latest version of Moode seems to be getting rid of more and more of the Python 2 reliance which I can understand. It has however thrown up some errors now in using this code. If anyone can help will be very happy otherwise I may have to look at other ways of using this great display which I do want to do.
error is:
Traceback (most recent call last):
File "/var/local/www/commandw/lcd_updater.py", line 79, in <module>
oled = OLED()
File "/var/local/www/commandw/OLED.py", line 78, in __init__
self.Clear_ram()
File "/var/local/www/commandw/OLED.py", line 109, in Clear_ram
for y in xrange(128):
NameError: name 'xrange' is not defined
dolomitejunkie commented
re-pulled the repo and made some local adjustments and now works. I should read your change log more carefully! that's holidays for you!
topherCantrell commented
Thanks for the email! You can change "xrange" to just "range" and it will
work for python3. I'll make the changes in my repo and look for other bombs.
Later,
Chris
…On Sun, Jan 1, 2023 at 11:43 AM Nicholas Kell ***@***.***> wrote:
been using this code to drive a display for Moode Audio. It's been rock
solid thank you.
the latest version of Moode seems to be getting rid of more and more of
the Python 2 reliance which I can understand. It has however thrown up some
errors now in using this code. If anyone can help will be very happy
otherwise I may have to look at other ways of using this great display
which I do want to do.
error is:
Traceback (most recent call last):
File "/var/local/www/commandw/lcd_updater.py", line 79, in <module>
oled = OLED()
File "/var/local/www/commandw/OLED.py", line 78, in __init__
self.Clear_ram()
File "/var/local/www/commandw/OLED.py", line 109, in Clear_ram
for y in xrange(128):
NameError: name 'xrange' is not defined
—
Reply to this email directly, view it on GitHub
<#5>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABKK6QPYQGI2BBFC64CDVSLWQG63HANCNFSM6AAAAAATOHJ2VQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
topherCantrell commented
I made the changes to "print" and "xrange" and merged them through. I don't have hardware setup here, so keep me posted!