您当前的位置: 首页 >  彭世瑜 Python

Python编程:sanic异步web框架

彭世瑜 发布时间:2019-01-19 11:21:25 ,浏览量:2

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)

关注
打赏
1688896170
查看更多评论

彭世瑜

暂无认证

  • 2浏览

    0关注

    2727博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文
立即登录/注册

微信扫码登录

0.0599s