05 2017 档案

摘要:假设url:http://0.0.0.0:18082/api/cluster/group?wzd=111&abc=cc 方法类型:POST,body是{"name":"abc"} 1. request.query 得到一个bottle的FormsDict对象,该对象可以转化为字典,里面的内容是: { 阅读全文
posted @ 2017-05-17 16:57 风起616 阅读(6469) 评论(0) 推荐(0)
摘要:from bottle import (run, route, get, post, default_app, Bottle) @route('/', method='GET') @route('/index') def hello(): return 'hello, word!' """ bottle的动态route提供了五种默认的类型,即... 阅读全文
posted @ 2017-05-11 14:27 风起616 阅读(2002) 评论(0) 推荐(0)
摘要:from bottle import (run, route, get, post, default_app, Bottle) """ 首先获得一个app对象,有两种方法,第一种是通过 default_app方法,另一种就是通过Bottle() """ app = default_app() # or via bottle.Bottle() app.co... 阅读全文
posted @ 2017-05-11 11:21 风起616 阅读(1560) 评论(0) 推荐(0)
摘要:from bottle import (run, route, get, post, put, delete) # bottle中添加路由的两种方法 # 第一种,使用route装饰器,需要指定method(get, put, delete,delete), # 如果不指定默认为get 方法 @route('/', method='GET') def hello(): return "h... 阅读全文
posted @ 2017-05-11 10:30 风起616 阅读(2742) 评论(0) 推荐(0)
摘要:如下表 1.只读模式(r)一个存在的文件: 正常输出: 2.只读模式(r)一个不存在的文件: 注意上面的文件名字变了,输出如下: 3.只读模式去写文件: 其他几种模式都差不多,不一一介绍了。 阅读全文
posted @ 2017-05-08 14:28 风起616 阅读(82790) 评论(3) 推荐(1)
摘要:输出如下:Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl -xe" fo 阅读全文
posted @ 2017-05-05 17:46 风起616 阅读(15651) 评论(0) 推荐(0)