Answers for "how to create templates in python"

-1

how to create templates in python

from string import Template
poem = Template('$x are red and $y are blue')

print(poem.substitute(x='roses', y='violets'))
#>>>roses are red and violets are blue
Posted by: Guest on November-17-2020

Code answers related to "how to create templates in python"

Python Answers by Framework

Browse Popular Code Answers by Language