Skip to content
Myr

cycle.py

This file

Path

examples/basic/cycle.py

13 lines · 277 bytes · Python

Last changed by

moved example code aroundArmin Ronacherbefore adoption612b3a8

History of this file

Take it

moved example code aroundArmin Ronacherbefore adoption612b3a8

lines 1–13why, one step back
1from jinja2 import Environment
234env = Environment(line_statement_prefix="#", variable_start_string="${", variable_end_string="}")567print env.from_string("""\8<ul>9# for item in range(10)10 <li class="${loop.cycle('odd', 'even')}">${item}</li>11# endfor12</ul>\13""").render()