application.py def hello(environ, start_response): start_response(‘200 OK‘, [(‘Content-Type‘, ‘text/html‘)]) return ‘<h1>Hello,WSGI!</h1>‘
from wsgiref.simple_server import make_server from application import hello httpd = make_server(‘127.0.0.1‘, 8000, hello) print "Serving HTTP on port 8000..." httpd.serve_forever()
原文:https://www.cnblogs.com/i-10ve-cpic/p/11428217.html