"if" syntax error

Andrew Kesterson legion at dialnet.net
Sat Sep 4 11:20:33 EDT 1999


I've got a CGI script (python) set to check the value of form element
"Listing_Type", and it does it as thus:

CGIHeaders = cgi.FieldStorage()
if CGIHeaders["Listing_Type"].value == "Residential":

when I compile it, I get this error:

  File "C:\Program Files\Python\Source\Skydev\addlisting.py", line 82
     if CGIHeaders["Listing_Type"].value == "Residential":
      ^
 SyntaxError: invalid syntax

	There is NO WAY that this is invalid syntax! I've used if comparisons
like that one hundreds of times and compiled fine!
	What's going on? Or is it just that my CGI *really* doesn't want to run
from command line?

-- 
"I never came across anyone in whom the moral sense
was dominant who was not heartless, cruel, vindictive,
log-stupid and entirely lacking in the smallest sense
of humanity. Moral people, as they are termed, are
simply beasts. I would sooner have fifty unnatural
vices than one unnatural virtue."
--Oscar Wilde




More information about the Python-list mailing list