Python 版本 2.7.18
使用 fastapi 实现 restful
参考:https://baijiahao.baidu.com/s?id=1666497036780966428&wfr=spider&for=pc ( Python 快速搭建 RESTful API )

fastapi 官网 https://fastapi.tiangolo.com/
https://fastapi.tiangolo.com/zh/

安装依赖

pip install fastapi
pip install uvicorn (使用 uvicorn 来运行 fastapi)

尴尬

FastAPI 是一个用于构建 API 的现代、快速(高性能)的 web 框架,使用 Python 3.6+ 并基于标准的 Python 类型提示。

fastapi 在 python 2.x 上没法使用。。。。

后面升级 Python 版本后再使用吧。

中文文档 https://fastapi.tiangolo.com/zh/

案例: https://www.pythonf.cn/read/100433