Skip to content

Instantly share code, notes, and snippets.

@python-consulting
Created January 28, 2014 15:22
Show Gist options
  • Save python-consulting/8669532 to your computer and use it in GitHub Desktop.
Save python-consulting/8669532 to your computer and use it in GitHub Desktop.
Python string template
>>> 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