1

python code line for get value from the form

pass = form.getvalue('name',)

when i try to set form data value to this 'pass' variable it gives two errors near the equal mark.

  1. End of statement expected.

  2. Statement expected, found py:EQ

Why?

1 Answers1

1

you're unlucky enough to have stumbled on a python keyword (the null statement that does nothing except make indentation happy).

hich is currently:

['and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif',
 'else', 'except', 'exec', 'finally', 'for', 'from', 'global', 'if', 'import',
 'in', 'is', 'lambda', 'not', 'or', 'pass', 'print', 'raise', 'return', 'try',
 'while', 'with', 'yield']

(from Is it possible to get a list of keywords in Python?)

As opposed to built-in functions like sum or list, keywords cannot be used / overridden without triggering strange syntax errors.

Jean-François Fabre
  • 137,073
  • 23
  • 153
  • 219
  • I didn't find any duplicate to this basic err, python :)) question so I answered as community wiki. If someone finds a proper duplicate feel free to suggest / close – Jean-François Fabre Oct 11 '17 at 22:04