Python Forum
SyntaxError 0x0f="" - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: SyntaxError 0x0f="" (/thread-34551.html)



SyntaxError 0x0f="" - Aisukurimubokkus - Aug-09-2021

Hello people,

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

I found this tutorial (http://www.rpiblog.com/2012/07/interfacing-16x2-lcd-with-raspberry-pi.html), but I always get SyntaxError in the "pylcdlib.py" file in line 76.

[attachment=1204]

Does anyone know what could be wrong?


RE: SyntaxError 0x0f="" - Larz60+ - Aug-09-2021

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.


RE: SyntaxError 0x0f="" - deanhystad - Aug-09-2021

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.