pyWeb is a Literate Programming tool that will work with any markup language and any programming langauge. The idea is to allow you to create great documentation with as constraints or limitations.
Teng is a general purpose templating engine written in C++ (i.e. library). It is also available as Python module or PHP extension. The main idea of teng is to strictly separate application logic from presentation layer. Widely used on dynamic web sites.