Python/cgi Was: Very useful message -- Hah!

Andy Robinson andy at robanal.demon.co.uk
Tue Dec 7 19:21:27 EST 1999


dgrassi <dan at grassi.org> wrote:

>It's python that needs to be changed.  Something simple like a keyword 
>that tells it to put out a header for Apache.  That is the fork I 
>mentioned above.

Look, you can write a subroutine in seconds to do exactly that, and
keep it in a library module you include in all your scripts.  Or,
better, write one CGI script handler once, and import the
content-generating code from another.  Or ten other solutions.

Furthermore, most of us don't care much if a CGI 'Hello World' is five
lines in PHP and 10 in Python - the 5-line overhead is a constant, not
a factor of four.  And I think that ultimately you are doing people a
favour by helping them learn about what they are writing out - there
is no 'magic'.

The Python philosophy is to keep the core clean and simple.  There are
no special builtin commands for web developers, or GUI developers, or
sockets developers, or any other kind.  If Guido did that, the core
language would grow unwieldy for everyone.

Out of curiosity, at work I have to control headers for customers in
different parts of Asia; stuff like 
	'content-type=text/html; charset=ShiftJIS'
which varies depending on the data I subsequently write out.  If PHP
builds this into the language, do you lose the ability to control the
headers when you actually need to?

- Andy




More information about the Python-list mailing list