+= doesn't work in python cgi's

Emile van Sebille emile at fenx.com
Mon Oct 8 06:28:36 EDT 2001


Are you running the same versions?

Instead of j+=1, try:
import sys
j = sys.version

IIRC, you need to be at version 2 or better to support +=

HTH,

--

Emile van Sebille
emile at fenx.com

---------
"Michael Palm" <msp at tpg.com.au> wrote in message
news:3BC17D83.A4EEED81 at tpg.com.au...
> 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