def application(environ, start_response): import cgi write_fn = start_response('200 OK', [('Content-Type', 'text/html')]) yield 'os.environment\n' \ '\n' \ '

os.environment

\n' \ '' names = environ.keys() names.sort() for name in names: yield '\n' % ( name, cgi.escape(`environ[name]`)) form = cgi.FieldStorage(fp=environ['wsgi.input'], environ=environ, keep_blank_values=1) if form.list: yield '' for field in form.list: yield '\n' % ( field.name, field.value) write_fn('\n'); yield '
%s%s
Form data
%s%s
This has been write()n:-)
\n' \ '\n' from wsgiref.handlers import CGIHandler CGIHandler().run(application)