Skip to content

Instantly share code, notes, and snippets.

@ricardochaves
Created October 19, 2016 18:14
Show Gist options
  • Save ricardochaves/a352a1bad0c0912c7524ef7b15b80e13 to your computer and use it in GitHub Desktop.
Save ricardochaves/a352a1bad0c0912c7524ef7b15b80e13 to your computer and use it in GitHub Desktop.
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))
@ricardochaves
Copy link
Author

Source here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment