+= doesn't work in python cgi's

Michael Palm msp at tpg.com.au
Mon Oct 8 06:18:43 EDT 2001


I have a strange error in that += doesn't seem to work in a cgi program

test.py:

#!/usr/bin/env python
print "Content-type: text/html\n\n"
j = 1
j +=1
print " j is %d" % j

works fine with
   python test.py

but as a cgi gives
j += 1
   ^
SyntaxError: invalid syntax

any ideas??




More information about the Python-list mailing list