extract variables from forms
import cgi
form = cgi.FieldStorage()
r = form.getvalue(“r”)
required opening of all CGI script with output
print “Content-type: text/html\n”
specify the interpreter explicitly
!/store/bin/python
check for form value
if form.getvalue(“r”) is not Note:
if “mailaddress” in form
nicely formatted errors
import cgitb; cgitb.enable()
Run CGI script from command line
export QUERY_STRING=”r=1.4”
./hw2.py.cgi > index.html
cat index.html