Reputation: 749
from mako.template import Template
stext = "hi"
mytemplate = Template(filename='./t.txt')
print mytemplate.render()
t.txt:
${hi} , i am here
Upvotes: 1
Views: 429
Reputation: 6536
Replace the last line with:
mytemplate.render(hi = "world")
Now, hi
can equal anything you like, not just "world"
.
Upvotes: 2