摘要: from gevent import monkeymonkey.patch_all()import geventimport requestsdef f1(url): print(f'GET:{url}') msg = requests.get(url) # 获取的是网站的数据长度 print(le 阅读全文
posted @ 2019-09-19 15:55 徐- 阅读(169) 评论(0) 推荐(0) 编辑
摘要: # # 线程池# import time# from concurrent.futures import ThreadPoolExecutor## pool = ThreadPoolExecutor(15)### def task(n1):# time.sleep(1)# print(f'任务{n1 阅读全文
posted @ 2019-09-19 15:53 徐- 阅读(111) 评论(0) 推荐(0) 编辑
摘要: import threadingfrom queue import Queue q = Queue() def porducer(i): """ 生产者 :param i: :return: """ print('产品:', i) info = {'to': '269', 'text': 'hell 阅读全文
posted @ 2019-09-19 15:52 徐- 阅读(119) 评论(0) 推荐(0) 编辑