The module we will use for this tutorial is again psycopg. It is available from http://www.initd.org/projects/psycopg1. So download it and install it using the directions that come with the package.
Once it is installed, you can import it like any other module:
# libs for database interface
import psycopg
If you would like your program to take input from the keyboard, you will also want to import the sys module. In this tutorial, I will illustrate how every major part of the SQL statement can be input from the keyboard. So, let your import line read as follows:
import sys, psycopg

