#!python3.7
# -*- coding: utf-8 -*-
author = 'LiXiaoXiaoXiaoBai'
data = "2021/6/2 23:10"
from wsgiref.simple_server import make_server
def app(enviro, start_response):
# 核心业务
# 生成响应的对象
start_response('200 OK', [('content-type', 'text/html')])
return ['<h3>Hello, World!</h3>'.encode('utf-8')]
httpd = make_server('', 8000, app)
print("Serving HTTP on port 8000...")
httpd.serve_forever()
浏览器直接访问http://localhost:8000/