• About
  • Archive
  • RSS

code.dump();

dirty

“A simple and dirty HTML/XML template library for Python 3.”

>>> from dirty.html import *
>>> page = xhtml(
...   head(
...     title("Dirty"),
...     meta(name="Author", content="Hong, MinHee <minhee@dahlia.kr>")
...   ),
...   body(
...     h1("Dirty"),
...     p("Dirty is a simple DSEL template library that...")
...   )
... )
>>> print(page)
<!DOCTYPE html PUBLIC
  "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" />
  <head>
    <title>Dirty</title>
    <meta content="Hong, MinHee <minhee@dahlia.kr>" name="Author" />
  </head>
  <body>
    <h1>Dirty</h1>
    <p>Dirty is a simple DSEL template library that...</p>
  </body>
</html>
  • Posted by inky
  • Tags:
    • python
    • html
  • July 25, 2009, 11:05pm

  • Permalink

About

A place for code snippets, keyboard shortcuts, dirty hacks and other fun tricks. Use at your own risk!

Members

  • inky
  • arood
  • beret
  • nosmo

Search

Colophon

A group tumblelog, originally by inky. Powered by Tumblr and themed by Bill Israel.