bottle框架如何在python 中使用

bottle框架如何在python 中使用

这篇文章给大家介绍bottle框架如何在python 中使用,内容非常详细,感兴趣的小伙伴们可以参考借鉴,希望对大家能有所帮助。

python有哪些常用库

python常用的库:1.requesuts;2.scrapy;3.pillow;4.twisted;5.numpy;6.matplotlib;7.pygama;8.ipyhton等。

1.安装

pip install bottle

2.调用方式:

from bottle import

3.功能使用:

完全模拟django框架,很轻量级

4.框架优点:

使用上代码量不多,但是可以实现适配各种web服务器

5.使用代码:

from bottle import route, run, request
@route('/hello')
def hello():
 return "Hello World!"
run(host='0.0.0.0', port=8080, debug=True)

关于bottle框架如何在python 中使用就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。