摘要: 1 import queue 2 # queue - A multi-producer, multi-consumer queue. 3 # ['Empty', Exception raised by Queue.get(block=0)/get_nowait() 4 # 'Full', Exception raised by Queue.put(block=0)/put_nowait... 阅读全文
posted @ 2018-01-16 14:56 魂~ 阅读(316) 评论(0) 推荐(0) 编辑
摘要: 1 import requests 2 import json 3 4 5 # 1、HTTP方法 6 requests.get('https://github.com/timeline.json') #GET请求 7 requests.post('http://httpbin.org/post') #POST请求 8 request... 阅读全文
posted @ 2018-01-16 11:52 魂~ 阅读(560) 评论(0) 推荐(0) 编辑
摘要: 1 import json 2 3 # json.dumps 用于将 Python 对象编码成 JSON 字符串。 4 print(json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}])) 5 print(type(json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}]))) 6 7 # json.... 阅读全文
posted @ 2018-01-16 10:51 魂~ 阅读(218) 评论(0) 推荐(0) 编辑