from wsgiref.simple_server import make_serverhtml
def application(environ, start_response):web
start_response('200 OK', [('Content-Type', 'text/html')])app
body = '<h1>Hello, %s!</h1>' % (environ['PATH_INFO'][1:] or 'web')code
return [body.encode('utf-8')]server
httpd = make_server('',8001,application)htm
print('Serving HTTP on port 8001......')utf-8
httpd.serve_forever()io