代码
from wsgiref.simple_server import make_server
def simple_app(environ, start_response):
status = '200 OK'
headers = [('Content-type', 'text/plain; charset=utf-8')]
start_response(status, headers)
html = '<h1>Hello World</h1>'.encode("utf-8")
return [html]
server = make_server("0.0.0.0", 9000, simple_app)
print("Begin Listening Port 9000......")
server.serve_forever()
执行后,浏览器访问
h1没生效,不知道为什么