Python Forum

Full Version: SyntaxError 0x0f=""
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.

[attachment=1204]

Does anyone know what could be wrong?
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.
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.