"if" syntax error

Aahz Maruch aahz at netcom.com
Sat Sep 4 13:22:12 EDT 1999


In article <37D138C1.3EABC811 at dialnet.net>,
Andrew Kesterson  <legion at dialnet.net> wrote:
>
>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

Is this the actual indentation within the program?  I ran into a similar
problem yesterday (not in *my* code ;-) that essentially looked like
this:

class foo():
  def a():
    pass
def b():
    pass
  def c():
    pass

Note that "def b()" is outdented an extra level.  You can also run into
similar problems if you mix tabs and spaces.
--
                      --- Aahz (@netcom.com)

Androgynous poly kinky vanilla queer het    <*>      http://www.rahul.net/aahz/
Hugs and backrubs -- I break Rule 6  (if you want to know, do some research)




More information about the Python-list mailing list