Chapter 11. Web Programming
Introduction
Credit: Andy McKay
The Web has been a key technology for many years now, and it has become unusual to develop an application that doesn’t involve some aspects of the Web. From showing a help file in a browser to using web services, the Web has become an integral part of most applications.
I came to Python through a rather tortuous path of ASP, then Perl, some Zope, and then Python. Looking back, it seems strange that I didn’t find Python earlier, but the dominance of Perl and ASP in this area makes it hard for new developers to see the advantages of Python shining through all the other languages.
Unsurprisingly, Python is an excellent language for web development,
and, as a “batteries included”
language, Python comes with most of the modules you will need. The
inclusion of xmlrpclib in Python 2.2 has made the
standard libraries even more useful. One of the modules I often use
is urllib, which demonstrates the power of a
simple, well-designed module—saving a file from the Web in two
lines (using urlretrieve) is easy. The
cgi module is another example of a module that has
enough to work with, but not too much to make the script too slow and
bloated.
Compared to other languages, Python seems to have an unusually large number of application servers and templating languages. While it’s easy to develop anything for the Web in Python, it would be peculiar to do so without first looking at the application servers available. Rather than continually ...