Python embedded like PHP

Jon Ribbens jon+usenet at unequivocal.co.uk
Wed Mar 27 06:34:38 EST 2002


In article <slrna9haud.e6b.akuchlin at ute.mems-exchange.org>, A.M. Kuchling wrote:
> Quixote turns the idea of templating on its head and embeds HTML in
> Python code.  Section 4 of
> http://www.amk.ca/python/writing/mx-architecture/ talks about why this
> turns out to be a really good idea.

... and 'jonpy' avoids the issue entirely by neither embedding Python
in HTML or HTML in Python. Its templating system embeds *no code of
any sort* in the HTML and this turns out to be completely super ;-).
See http://jonpy.sourceforge.net/wt-examples.html#templatecode for
examples.

This is especially useful when you have different people generating
the HTML and the code (as it almost always the case). The designer is
much less likely to mangle the 'significant' parts of the HTML files,
and even if they do, it's a matter of seconds to fix. Additionally,
when the customer says "actually, we don't like the style of the site,
we want it changed" and you get sent a whole bunch of new code-less
HTML files, with a PHP-style code-in-HTML you pretty much have to
reimplement the entire site from scratch, whereas with this system you
just add back in the section markers and the code (which was in
separate files anyway) does not usually need to be changed at all.

Cheers


Jon



More information about the Python-list mailing list