Python: Fancy String Substitution


/ Published in: Python
Save to your folder(s)



Copy this code and paste it in your HTML
  1. def index(title, content):
  2. return """
  3. <html>
  4. <head>
  5. <title>%(title)s</title>
  6. </head>
  7. <body>
  8. %(content)s
  9. </body>
  10. </html>
  11. """ % {'title':title, 'content':content}

URL: http://stackoverflow.com/questions/98245/what-is-your-single-favorite-python-templating-engine/99291#99291

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.