Next / Previous / Contents / TCC Help System / NM Tech homepage

4.3. Imports

We'll need two standard Python modules: sys for the standard streams, and os for the popen function to execute commands in a subshell, and the environ dictionary containing the currently defined environmental variables.

manweb.cgi
#================================================================
# Imports
#----------------------------------------------------------------

import sys, os

Python's cgi module takes care of retrieving the arguments from the URL.

manweb.cgi
import cgi

The Python regular expression module will handle checking the arguments for correct syntax.

manweb.cgi
import re