Hi Frederic,
You can actually use patrom in the browser :
<html>
<head>
<meta charset="utf-8">
<script src="/src/brython.js"></script>
<script src="/src/brython_stdlib.js"></script>
</head>
<body onload="brython(1)">
<script type="text/python">
import patrom
from browser import document
document.html = patrom.render("test.tmpl", name="pierre")
</script>
</body>
</html>
with this in file test.tmpl :
Votre nom est <py expr="name"/>
<br>
<ul>
<py code="for i in range(5, 10):">
<li><py expr="i" />
</py>
</ul>
But it takes quite a long time because of the many imports needed. In a browser we have a built-in HTML parser, and since patrom templates are pure HTML, this parser can be use instead of html.parser in the Python library.
In the latest versions in the repository I have added a still experimental module simply called browser.template ; example :
<html>
<head>
<meta charset="utf-8">
<script src="/src/brython.js"></script>
</head>
<body onload="brython(1)">
<script type="text/python">
from browser import document, template
document['result'].html += template.Template("test.tmpl").render(name="Pierre")
</script>
<div id="result"></div>
</body>
</html>