📅  最后修改于: 2022-03-11 14:48:10.177000             🧑  作者: Mango
>>> from jinja2 import Template
>>> s = "{% for element in elements %}{{loop.index}} {% endfor %}"
>>> Template(s).render(elements=["a", "b", "c", "d"])
1 2 3 4