Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SyntaxError 0x0f=""
#1
Sad 
Hello people,

I have a problem and I have no idea what's wrong.

I found this tutorial (http://www.rpiblog.com/2012/07/interfaci...ry-pi.html), but I always get SyntaxError in the "pylcdlib.py" file in line 76.

   

Does anyone know what could be wrong?
Yoriz write Aug-09-2021, 05:46 AM:
Please post all code, output and errors (in their entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.

Attached Files

.py   pylcdlib.py (Size: 3.23 KB / Downloads: 230)
.py   test_lcd.py (Size: 176 bytes / Downloads: 267)
Reply
#2
0x0f is not a valid python variable name.
in hex, 0x0f could be a mask used to AND lower 4 bits.

I'm not sure what was intended on this line, but code must not have been tested as it would always, properly, give a syntax error.
Reply
#3
I don't think that was ever valid Python, but even if it were, you should look for a more up-to-date tutorial. All the comments are from 2012, and the command it uses to write to the I2C bus isn't even supported by the current version of the library.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020