Python's Apache interpreter is available as an Apache module,
mod_python. This module reduces the time it takes to deliver a
given page to a client. It is also capable of a great deal more,
including interacting with Apache itself in various powerful
ways. This article gives you just a taste of what mod_python can
do. I'm sure many of you are coming from a CGI background and
have several CGI scripts sitting around. Fortunately for you,
mod_python can emulate a CGI enviroment and run your old
scripts. Create a directory called pycgi. Create a .htaccess
file and add this to it: We'll now create a simple "CGI" script:
import cgi formData = cgi.FieldStorage() if 'name' in formData:
name = formData [ 'name' ].value else: name = 'John Doe' print
'Content-type: text/html' print print 'Hello, ', name + '.' You
should not, however, rely on this method. It has a few problems,
and mod_python offers much more efficient methods of doings
things, as I explained at the beginning of the article. Let's
not waste a perfectly g