from wsgiref simple_server import make_server def hello_world_app envi

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
from wsgiref.simple_server import make_server
def hello_world_app(environ, start_response):
status = '200 OK' # HTTP Status
headers = [('Content-type', 'text/plain')] # HTTP Headers
start_response(status, headers)
# The returned object is going to be printed
return ["Hello World"]
httpd = make_server('', 8100, hello_world_app)
print "Serving on port 8100..."
# Serve until process is killed
httpd.serve_forever()