![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
线程
我的目标吉良吉影
这个作者很懒,什么都没留下…
展开
-
Python多线程爬取表情包
import requestsfrom lxml import etreeimport threadingimport queueimport timerequest_url=queue.Queue()url_queue=queue.Queue()last_queue=queue.Queue()mutex=threading.Lock()url_lock=threading.Lock()pic_downlode=threading.Lock()for i in range(40):.原创 2020-09-10 08:52:54 · 195 阅读 · 0 评论 -
python 启动线程池
from concurrent.futures import ThreadPoolExecutorfrom threading import current_threadimport timetp =ThreadPoolExecutor(4)#启动线程个数def c(i): print(current_thread().ident)#获取线程id time.sleep(1) print(i)for i in range(20): ret =tp.submit(c,.原创 2020-09-08 13:14:29 · 352 阅读 · 0 评论