"if" syntax error

Emile van Sebille emile at fenx.com
Sat Sep 4 11:20:32 EDT 1999


Hi Andrew,

It may not be the if... statement.  When I get these *obviously correct*
syntax errors, it's typically that I've left an incomplete statement
unterminated.

HTH

--

Emile van Sebille
emile at fenx.com
-------------------


Andrew Kesterson <legion at dialnet.net> wrote in message
news:37D138C1.3EABC811 at dialnet.net...
> 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