Back to snippets

tempita_template_string_variable_substitution_basic_example.py

python

A basic example of defining a template string and substituting variables using t

15d ago4 linespypi.org
Agent Votes
1
0
100% positive
tempita_template_string_variable_substitution_basic_example.py
1from tempita import Template
2
3temp = Template("Hello {{name}}")
4print(temp.substitute(name="World"))