Home arrow Python arrow Page 2 - Writing CGI Programs in Python

Why should my next CGI project be in Python? - Python

And now for something completely different... Python has a very extensive, well documented and portable module library that provides a large variety of useful functions. The Internet-related collection is particularly impressive, with modules to deal with everything from parsing and retrieving URL's to retrieving mail from POP servers and everything in between.

TABLE OF CONTENTS:
  1. Writing CGI Programs in Python
  2. Why should my next CGI project be in Python?
  3. Your First CGI program in Python
  4. Getting some real work done
  5. Defining a useful Display function
  6. Putting the pieces together
  7. Simple Database Access
  8. Other Resources and Links
By: Preston Landers
Rating: starstarstarstarstar / 78
August 25, 1999

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement
First of all, it should be stated that Python is a general purpose programming language. Though it is well suited for almost every type of web application, if you need a few simple SSI (server-side include) pages a language like PHP might be more suitable.

Perl is well known as the "King of CGI." Perl is uniquely suited as a text scanning and processing language, and its CGI related modules are extensive and well implemented. However, even an old-time Perl hacker will usually tell you that Perl really shines in one-person 'quickie' jobs that will never have to be maintained by another human being. The combination of Perl's line-noise-like syntax and "There's More Than One Way To Do It" philosophy often results in an unmaintainable mess of a program.

That's not to say that interesting and powerful applications can't be written in Perl. In addition, knowledge of the language itself is often necessary for cleaning up other people's messes. However, if you are starting a brand new web application, you should consider Python and its "There Should Be One Obvious Way To Do It" philosophy.

Python has a much cleaner syntax than most languages and object orientation is built right into the core. [Overt use of object features such as classes is entirely optional; Python can be used as a straightforward scripting language.] Python's clean, readable syntax is a blessing to new developers learning the language and also to people who have to maintain other people's code.

People developing with the Apache web server (and according to Netcraft, that's most of you) will be pleased to know about the mod_python module that embeds the Python interpreter directly into Apache, resulting in application execution speeds to rival Perl.

Lastly, Python has a very extensive, well documented and portable module library that provides a large variety of useful functions. The Internet-related collection is particularly impressive, with modules (Python function/class libraries) to deal with everything from parsing and retrieving URL's to retrieving mail from POP servers and everything in between. Other modules handle everything from GUI interfaces (using a variety of popular toolkits) to database access.



 
 
>>> More Python Articles          >>> More By Preston Landers
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

PYTHON ARTICLES

- Python Big Data Company Gets DARPA Funding
- Python 32 Now Available
- Final Alpha for Python 3.2 is Released
- Python 3.1: String Formatting
- Python 3.1: Strings and Quotes
- Python 3.1: Programming Basics and Strings
- Tuples and Other Python Object Types
- The Dictionary Python Object Type
- String and List Python Object Types
- Introducing Python Object Types
- Mobile Programming using PyS60: Advanced UI ...
- Nested Functions in Python
- Python Parameters, Functions and Arguments
- Python Statements and Functions
- Statements and Iterators in Python

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: