Skip to content
Myr

cycle.py

This file

Path

examples/basic/cycle.py

18 lines · 340 bytes · Python

Last changed by

Merge pull request #1133 from pallets/revert-renameDavid Lordbefore adoption15337f7

History of this file

Take it

1from __future__ import print_function23from jinja2 import Environment45env = Environment(6    line_statement_prefix="#", variable_start_string="${", variable_end_string="}"7)8print(9    env.from_string(10        """\11<ul>12# for item in range(10)13    <li class="${loop.cycle('odd', 'even')}">${item}</li>14# endfor15</ul>\16"""17    ).render()18)