+= doesn't work in python cgi's (extra info)

Michael Palm msp at tpg.com.au
Mon Oct 8 09:43:41 EDT 2001


Forgot info on my setup:
Redhat 7.1/Apache 1.3.17/Python 2.1
Seems to work OK on Win95/Apache 1.3.2/Python 2.1 (veeeerrry slooowww)

Michael Palm wrote:

> 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