[Web-SIG] Pure Python HTML?

Martijn Faassen faassen at infrae.com
Wed Apr 13 15:12:16 CEST 2005


Bill Janssen wrote:
>>I don't know about you, but generating HTML with pure Python code can be
>>messy--ONE reason why we introduce templateing languages in the first
>>place. Often (not always) the best way to end up with XHTML is to start
>>with a valid or almost-valid XML document and then infuse the dynamic
>>content.
> 
> 
> Indeed.  And in Python I do it with string formatting:
[snip]

This works for small scale projects where only a few developers are 
expected to know the codebase. But in a larger scale project where you 
have to work with web designers which may not know a lot of Python, this 
doesn't really work.

There are also other aspects, like i18ning your HTML, which would be 
hard to do with your example.

It's the black box principle; I don't want to go through your Python 
code just to tweak a bit of HTML. The idea of ZCML is for programmers to 
be able to reconfigure or extend the behavior of other people's code 
without having to change, or hopefully even fully understand, that code 
itself. The idea is that this pays off once you are working in a larger 
scale project or cluster of projects, like in the Zope community.

I don't think this discussion will go anywhere though, as your position 
seems to be too extreme in this respect to easily move out of. :)

Regards,

Martijn


More information about the Web-SIG mailing list