for item in list(form.keys()):
    s.wfile.write('<p>Item: ' + item)
s.wfile.write('<p>Value: ' + form[item].value)
s.wfile.write('</body></html>')
if __name__ == '__main__':
    server_address = '', 8000
httpd = CGIHTTPServer.BaseHTTPServer.HTTPServer(server_address,
    MyRequestHandler)
try:
    httpd.serve_forever()
except KeyboardInterrupt:
    sys.exit()
Глобальная переменная на сервере Python