1. 代码示例
1.1 安装原先Flask
- pip install flask
from werkzeug.serving import run_simple
from werkzeug.wrappers import BaseResponse
def func(environ, start_response):
print('请求来了')
response = BaseResponse("你好")
return response(environ, start_response)
if __name__ == '__main__ ':
run_simple('127.8.0.1', 5006, func)