1. Home
  2. Computing & Technology
  3. Python

Programming CGI With Python

By Al Lukaszewski, About.com

1 of 4

Python CGI First Steps: Importing cgi and cgitb

To use a Python program as a CGI script, you must import the cgi module. For purposes of troubleshooting your script, you should also import the module cgitb. This provides alternative exception handlers which offer more informative error messages in the event of an exception. While you can write CGI scripts without cgitb, it is recommended for its helpful exception handling.

If you have trouble running your CGI scripts, remember to check your permissions and the setup of your Apache server. If you do not have administrator access to your web server, check with someone who does. Other important items to keep in mind are found at About.com's Webdesign site.

Index: Programming CGI With Python

  1. Python CGI First Steps: Importing cgi and cgitb
  2. Accessing CGI Form Data
  3. Attributes of FieldStorage
  4. Other Methods of Accessing Data

1 of 4

Explore Python

More from About.com

  1. Home
  2. Computing & Technology
  3. Python
  4. Web Development
  5. Python CGI - Programming CGI With Python - How to Program CGI in Python

©2008 About.com, a part of The New York Times Company.

All rights reserved.