Genshi TemplateSyntaxError on python block where it should work
-
22-09-2019 - |
Question
<?python class += 1 ?>
One really simple line of code which definitely should work, but still it gives me this error:
TemplateSyntaxError: invalid syntax (file.html, line 22)
I shorted the filepath for readability, but that's the exact error. I'm definitely sure it should work, as I've used
<?python
i += 1
?>
In another file, and it worked just fine there. Almost exact same structure; a table and a py:for loop. Tried everything, but can't get it to work! Any help?
Solution
class
is a Python keyword. You can't name a variable that.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow