sanic Python web服务器和框架
sanic简介
sanic,Python第三方库,是一个Python的web服务器和web框架,编写速度很快,允许使用Python 3.5中添加的async/await语法,代码无阻塞且快速。sanic可以用于建立和运行高性能的HTTP服务器。
sanic应用实例
from sanic import Sanic
from sanic.response import json
app = Sanic("my-hello-world-app")
@app.route('/')
async def test(request):
return json({'hello': 'world;hello, 笨鸟工具, x1y1z1.com'})
if __name__ == '__main__':
app.run()
sanic Github统计数据
MIT license
Github 17.5k stars
sanic安装命令
pip3 install sanic
Python版本要求
sanic 23.6.0 Requires: Python >=3.8 (数据来源:pypi)
免责声明:内容编辑自网络,仅供参考,不保证正确性,不作任何决策依据!!以上数据皆截止于博文的写稿日期。