< BACKMake Note | BookmarkCONTINUE >
152015024128143245168232148039199167010047123209178152124239215162148040135186111045046177

Web Programming

Python has a very extensive, well documented and portable module library that provides a large variety of useful modules. The Internet-related collection is particularly impressive, with modules that deal with everything from parsing and retrieving URLs to retrieving mail from POP servers, including CGI scripting.

Python is suitable for CGI programming on Windows, Mac, and UNIX platforms, allowing the creation of programs that provide services over the Internet. Its capability to create dynamic content makes the task of generating Web pages on-the-fly a very easy thing to do.

However, before starting to implement your Web pages using CGI scripts, you need to think about whether it is really necessary to build dynamic pages for your site. Keep in mind that if the information is not modified very often, static pages are the best solution because dynamic pages always slow down the server. You can decide whether to use it, but if you conclude that it would work for you, this chapter might help you a lot.

Note

It's also good to mention that if you need a way to periodically build auto-generated pages, you can implement solutions based on the use of cron on UNIX-like systems. For the Windows NT, you have both the at command, and the scheduled tasks extensions found in the newer copies of the Internet Explorer.



If your site becomes busy enough that the cost of starting a Python interpreter for each CGI request becomes significant, you can use Web Server modules (such as mod_python) to embed the Python interpreter in the server, hence, avoiding the startup time. Zope provides yet another way to have Python scripts without the interpreter startup time to worry about. Python code can also be invoked on top of Active Server Pages (ASP) under IIS.


Last updated on 1/30/2002
Python Developer's Handbook, © 2002 Sams Publishing

< BACKMake Note | BookmarkCONTINUE >

Index terms contained in this section

applications
      Z Object Publishing Environment (Zope)
autogenerated pages
CGI (Common Gateway Interface) scripts
Common Gateway Interface (CGI) scripts
embedding
      interpreters in servers
interpreters
      embedding in servers
pages
      autogenerated
programs
      Z Object Publishing Environment (Zope)
scripts
      Common Gateway Interface (CGI)
servers
      embedding interpreters
software
      Z Object Publishing Environment (Zope)
Z Object Publishing Environment (Zope)
Zope (Z Object Publishing Environment)

© 2002, O'Reilly & Associates, Inc.