+= doesn't work in python cgi's

piet at cs.uu.nl piet at cs.uu.nl
Mon Oct 8 08:08:44 EDT 2001


>>>>> Michael Palm <msp at tpg.com.au> (MP) writes:

MP> I have a strange error in that += doesn't seem to work in a cgi program
MP> test.py:

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

MP> works fine with
MP>    python test.py

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

MP> any ideas??

It probably invokes an older version of python.
-- 
Piet van Oostrum <piet at cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP]
Private email: P.van.Oostrum at hccnet.nl



More information about the Python-list mailing list