1. Home
  2. Computing & Technology
  3. Python

Programming CGI With Python

From , former About.com Guide

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.

Explore Python
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

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

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

All rights reserved.