标签:ica ber pac rtl block line span start height
20170831 基于wsgi的web简易框架
from wsgiref.simple_server import make_server
def application(environ, start_response):
# 通过environ封装成一个所有请求信息的对象
# start_response可以很方便的设置响应头
start_response(‘200 OK‘, [(‘Content-Type‘, ‘text/html‘)])
return [b"<h1>hello world</h1>"]
# 封装了socket对象以及准备过程(bind, listen)
httpd = make_server(‘‘, 8080, application)
print(‘Serving HTTP on port 8080...‘)
# 开始监听HTTP请求:
httpd.serve_forever()
标签:ica ber pac rtl block line span start height
原文地址:http://www.cnblogs.com/gengwenhao/p/7466305.html