#!/usr/bin/python3 import cgi form = cgi.FieldStorage() # parse form data print('Content-type: text/html\n') # hdr plus blank line print('Reply Page') # html reply page if not 'user' in form: print('

Who are you?

') else: print('

Hello %s!

' % cgi.escape(form['user'].value))