CGI: Run Script then load page

Harry George hgg9140 at seanet.com
Sun Aug 5 20:11:26 EDT 2001


Tom Robinson <tom at alkali.spamfree.org> writes:

[snip]
> 
> Coming from a perl background I was surprised there isn't a header
> building function in the cgi module ... any reason behind this, or did
> they just not think of it?
> 

When I came from perl, I thought the same thing, so I built cgipm.py
(a workalike for Stein's CGI.pm).  Others on c.o.l.a told me they just
tended to write raw "print" statements in python, and not worry about
shortcuts.

After about a year of using my cgipm.py, I came to the same
conclusion: The shortcuts hide the verbosity but not the complexity of
HTTP and HTML.  Writing it out raw takes a bit more space but makes
everything obvious -- and thus maintainable by people who have never
heard of perl's cgi.pm or any other package of shortcuts.

So now I write the raw lines, but of course use python-isms to assure
it happens only once, in a non-redundant way.  Still, if you'd like
cgi.pm-style shortcuts, see cgipm.py at:

http://www.seanet.com/~hgg9140/comp/index.html


> -- 
> tom at alkali.spamfree.org
> remove 'spamfree.' to respond

-- 
Harry George
hgg9140 at seanet.com



More information about the Python-list mailing list