python bottle学习(一)快速入门

原文链接:https://www.cnblogs.com/dadong616/p/6839671.html

from collector import *
from scripts.agent import *
import util


# bottle中添加路由的两种方法
# 第一种,使用route装饰器,需要指定method(get, put, delete,delete),
# 如果不指定默认为get 方法
@route('/', method='GET')
def hello():
    return "hello, word!"



if __name__ == '__main__':

    # run方法中的reloader是一个很实用的功能,调试的时候修改完代码
    # 服务会自动重启,方便开发。
    run(host='0.0.0.0', port=8080, debug=True, reloader=True)
参考链接: http://www.cnblogs.com/dadong616/tag/bottle/

猜你喜欢

转载自blog.csdn.net/liuxiangke0210/article/details/80334265
今日推荐