Posted By

tclancy on 01/17/10


Tagged


Versions (?)

Python: Fancy String Substitution


 / Published in: Python
 

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

  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}

Report this snippet  

You need to login to post a comment.