#!/usr/bin/python import os import cgi import cgitb; cgitb.enable() def cgiParams( fieldStorage ): """Get a plain dictionary, rather than the '.value' system used by the cgi module.""" params = { 'what' : ''} for key in fieldStorage.keys(): if key in params: params[ key ] = fieldStorage[ key ].value return params dict = cgiParams( cgi.FieldStorage() ) #print "Content-Type: application/xhtml+xml\n" print "Content-Type: text/html\n" xhtml = """ %s %s %s %s """ title = "TenSen.net" meta = "" stylesheet = "styles/tensen.css" stylesheets = "" body = "Define %s " % (dict['what']) print xhtml % (title, meta, stylesheet, stylesheets, body)