Created
October 19, 2016 18:14
-
-
Save ricardochaves/a352a1bad0c0912c7524ef7b15b80e13 to your computer and use it in GitHub Desktop.
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 | |
class MyOtherTemplate(Template): | |
delimiter = "#" | |
data = dict(id = 1, name = "Ricardo") | |
t = MyOtherTemplate("My name is #name and I have the id: #id") | |
print(t.substitute(data)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Source here