[Tutor] Syntax Problem

wesley chun wescpy at gmail.com
Sat Jul 25 00:25:30 CEST 2009


On Fri, Jul 24, 2009 at 2:34 PM, Jesse Harris<mrjesseh at yahoo.com> wrote:
> for d in Decks.all(): #loop thru all available decks
>           self.response.out.write('<OPTION>'+d.name)
>           self.response.out.write('<OPTION>'+d.description)
> self.response.out.write('</SELECT></div>')
> self.response.out.write('<div style="float:left">')
>
> <type 'exceptions.SyntaxError'>: invalid syntax (main.py, line 206)
>       args = ('invalid syntax', (r'C:\Program
> Files\Google\google_appengine\bangagears2\main.py', 206, 78, "
> \t\tself.response.out.write('<OPTI...elf.response.out.write('<OPTION>'+d.description)\n"))
>       filename = r'C:\Program
> Files\Google\google_appengine\bangagears2\main.py'
>       lineno = 206
>       message = ''
>       msg = 'invalid syntax'
>       offset = 78
>       print_file_and_line = None
>       text = "
> \t\tself.response.out.write('<OPTI...elf.response.out.write('<OPTION>'+d.description)\n"


can't really tell from the TB what the problem is, but perhaps
changing the leading tabs to spaces may help, and make sure there is a
clean linebreak between pair of lines in the for-loop (and also have
leading spaces in front of the 2nd line).

-- wesley
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"Python Web Development with Django", Addison Wesley, (c) 2009
http://withdjango.com

wesley.j.chun :: wescpy-at-gmail.com
python training and technical consulting
cyberweb.consulting : silicon valley, ca
http://cyberwebconsulting.com


More information about the Tutor mailing list