0
点赞
收藏
分享

微信扫一扫

Python编程:sanic异步web框架

忍禁 2022-02-17 阅读 90


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)



举报

相关推荐

0 条评论