2.1 Code Sections

Code Sections are enclosed between ``<%'' and ``%>''. They are executed as a series of Python statements and any output is printed at the location they occur in the body. It is suggested that code segments start and end with lines containing only the enclosures. Code sections must be a complete set of Python statements. Thus this segment is correct:

<%
for i in range(10):
   print "this is line \%d" % i
%>

while this segment will cause an error:

<%
for i in range(10):
   print "this won't work"%>