Python web development that resembles PHP or classic ASP

Ivan Illarionov ivan.illarionov at gmail.com
Tue May 27 03:36:20 EDT 2008


On Tue, 27 May 2008 09:10:40 +0200, Bruno Desthuilliers wrote:

> Ivan Illarionov a écrit :
>> On Mon, 26 May 2008 21:26:55 +0200, Sebastian 'lunar' Wiesner wrote:
>> 
>>> [ Ivan Illarionov <ivan.illarionov at gmail.com> ]
>>>
>>>> If the OP wants PHP-style programming he will get better results with
>>>> PHP because PHP was designed this way. Any Pythonic solution will be
>>>> an overkill.
>>> Better shoot yourself in the foot with a PHP-like Python-thing, than
>>> committing suicide by shooting yourself into the head with PHP ...
>> 
>> :) I can't imagine anything uglier than Python with its significant
>> whitespace wrapped inside HTML. I guess it could be more damaging than
>> PHP which was written exactly for this purpose.
> 
> Mako template's syntax looks not so ugly to me:
> 
> <%inherit file="base.html"/>
> <% rows = [[v for v in range(0,10)] for row in range(0,10)] %> <table>
>      % for row in rows:
>          ${makerow(row)}
>      % endfor
> </table>
> 
> <%def name="makerow(row)">
>      <tr>
>      % for name in row:
>          <td>${name}</td>\
>      % endfor
>      </tr>
> </%def>

Mako templates are alright. I like them more than Django templates.



More information about the Python-list mailing list