If the replacement field is part of a word, the name must be enclosed in braces : Template : String PYTHON TUTORIALS


PYTHON TUTORIALS » String » Template »

 

If the replacement field is part of a word, the name must be enclosed in braces


from string import Template


s = Template("It's ${x}tastic!")
s.substitute(x='slurm')
print s



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo String
» Template