Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import string
- values = {'var': 'foo'}
- t = string.Template("""
- Variable : $var
- Escape : $$
- Variable in text: ${var}iable
- """)
- print 'TEMPLATE:', t.substitute(values)
- s = """
- Variable : %(var)s
- Escape : %%
- Variable in text: %(var)siable
- """
- print 'INTERPOLATION:', s % values
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement