import cgi form = cgi.FieldStorage() print 'Content-type: text/html\n' if form.has_key("typed"): print 'You typed <b>%s</b>' % (form['typed'].value) else: print 'You didn\'t type anything!'