lit is Language Independent Template engine. lit-python is python implementation.
You can use any statements of the script language. It'll be executed. <% a = 1 + 5 b = 'Hello World' %>
You can use any expressions of the script language. It'll be evaluated and printed. <%= 5 + 5 %>
<%!
import re
%>
directive gives special control.
lit support template inheritance.
<%@ extends name="parent_template" %>
<%@ block name="header" %>
<ul class="menu">
<li>…</li>
…
</ul>
<%@ endblock %>
specify optional parameters. for example, you can execute lit with RestrictedPython with this: <%@ page name="runtime" value="restricted" %> or you can change template language: <%@ page name="language" value="JavaScript" %>
easy_install lit-python
or pip install lit-python
from lit.template import Template
Template(text=u'blahblah…').render(a=1, b='hello')
Template(filename='hello', lookup=TemplateLookup(directories=['.', './templates']))