#!/Library/Frameworks/Python.framework/Versions/Current/bin/python # L-23 MCS 275 Fri 5 Mar 2010 : use_forms.py import cgi def PrintHeader(title): """ writes title and header of page """ print """Content-type: text/html %s """ % title PrintHeader("using forms") print """Enter a word

""" form = cgi.FieldStorage() if form.has_key("word"): print """

Your word is %s

""" % form["word"].value print "\n"