Python编程:sanic异步web框架

github: https://github.com/huge-success/sanic

使用方式和Flask 基本一致

安装

pip3 install sanic

最简单的示例

# -*- coding: utf-8 -*-

from sanic import Sanic
from sanic.response import text

app = Sanic()


@app.route('/')
async def hello(request):
    return text("hello sanic")


if __name__ == '__main__':
    app.run(host='0.0.0.0', port=8000)


上一篇:linux下如何增量增量传输mysql binlog日志


下一篇:【PTA】7-3 判断上三角矩阵 (15分)