#!/usr/bin/python import os import sys parms = { } output = "" sys.stderr = sys.stdout print 'Content-type: text/html' if 'QUERY_STRING' in os.environ: qs = os.environ['QUERY_STRING'] if len(qs) > 0: pairs = qs.split('&') for pos in range(0, len(pairs)): name, value = pairs[pos].split('=') parms[name] = value hobby = "" if 'hobby' in parms: hobby = parms['hobby'] output = output + '''\ First Python Script

This is a simple HTML page that has a form in it.

The hobby was received as: {0}

Hobby:

'''.format(hobby) print '''Content-length: {0} {1} '''.format(len(output), output)