Created
January 28, 2014 15:22
-
-
Save python-consulting/8669532 to your computer and use it in GitHub Desktop.
Python string template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> from string import Template | |
>>> s = Template('$who likes $what') | |
>>> s.substitute(who='tim', what='kung pao') | |
'tim likes kung pao' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment