Python embedded like PHP

Paul Rubin phr-n2002a at nightsong.com
Wed Mar 20 06:45:09 EST 2002


Andy Gimblett <gimbo at ftech.net> writes:
> Have a look at this example (from
> http://www.zope.org/Members/peterbe/DTML2ZPT):
> 
> <ul tal:define="sequence python:container.mydb.selectbyname(name='peter')">
>   <li tal:repeat="item sequence">
>     <span tal:replace="item/surname">surname</span>
>   </li>
> </ul>
> 
> Now, that's perfectly valid HTML, most WYSYWIG editors will basically
> ignore the tal: attributes and render a single-element list, but the
> ZPT machinery in Zope will pick that up and render a multi-element
> list in a manner which I think it pretty obvious from looking at the
> source.
> 
> In short, I think it's super-neato.  :-)

Geez, I find all this pseudo-HTML horrendous.  Why not just embed
normal looking code in <?  ?> tags the way PHP does it?  Do WYSIWYG
editors have a problem with that?  If worse comes to worse, embed
the Python code with the kinds of tags used for Javascript.  The
WYSIWYG editors should be used to Javascript by now.




More information about the Python-list mailing list