Mega Code Archive
Categories
/
Python Tutorial
/
String
Template systems (in this case using HTML)
from string import Template template = '''
%(title)s
%(title)s
%(text)s
''' data = {'title': 'My Home Page', 'text': 'Welcome to my home page!'} print template % data