7.2. String Template — Python
Simple string substitution mechanism
Uses placeholders in the form of
$placeholderfrom string import TemplateDo not confuse it with
string.templatelib.Template
>>> from string import Template >>> >>> template = Template("Hello, $name! Today is $day.") >>> template.substitute(name="Alice", day="Friday") 'Hello, Alice! Today is Friday.'