D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
usr
/
share
/
doc
/
python-jinja2-2.7.2
/
examples
/
basic
/
Filename :
cycle.py
back
Copy
from jinja2 import Environment env = Environment(line_statement_prefix="#", variable_start_string="${", variable_end_string="}") print env.from_string("""\ <ul> # for item in range(10) <li class="${loop.cycle('odd', 'even')}">${item}</li> # endfor </ul>\ """).render()