Dan Eloff
dan.eloff at gmail.com
Thu Jan 26 15:31:22 EST 2006
That makes sense. I still am having a syntax error, but a different one now, it's complaining about the for loop. 15. """,0); <% 16. for href, text in vars.main_menu: for href, text in vars.main_menu: 17. # Begin menu loop # Begin menu loop 18. req.write(""" %> 19. <li><a href=\"""",0); req.write(str(href),0); req.write ("""\">""",0); req.write(str(text),0); req.write("""</a></li> <li><a href="<%=href%>"><%=text%></a></li> 20. """,0); <% 21. # End of menu loop # End of menu loop 22. req.write(""" %> What am I doing wrong this time? Thanks, -Dan On 1/26/06, Graham Dumpleton <grahamd at dscpl.com.au> wrote: > > On 27/01/2006, at 5:08 AM, Dan Eloff wrote: > > > Could someone please tell me why this: > > > > <% for href, text in vars.main_menu: %> > > <li><a href="<%=href%>"><%=text%></a></li> > > <% # End of menu loop > > %> > > > > Is turuend into: > > for href, text in vars.main_menu: ;req.write(""" .... > > > > With that extra ; right after the loop? It creates a syntax error. > > > > How might I write my psp so as to avoid that? > > From memory, try: > > <% > for href, text in vars.main_menu: > # fake indent > %> > <li><a href="<%=href%>"><%=text%></a></li> > <% > # end of loop > %> > > If you aren't going to use a tab stop (8 spaces) of indent, you have to > provide additional hinting. Blocks of code is also better off not having > the <% %> on same lines as code. > > Graham > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20060126/0a5d7ec3/attachment.html
|