多线程
天主极乐大帝
这个作者很懒,什么都没留下…
展开
-
多线程加锁
from threading import Lockfrom multiprocessing import Processfrom threading import Thread#锁将并行操作变成串行操作def work1():global a,bfor i in range(1000000):mutex.acquire()a += 1 mutex2.acquire...原创 2019-03-13 20:04:14 · 609 阅读 · 0 评论 -
多线程爬取安客居
import requestsfrom lxml import etreeimport threadingfrom queue import Queueimport timeimport reimport pymysqldef is_none(message_list): if message_list: return message_list[0...原创 2019-08-30 21:59:43 · 1085 阅读 · 0 评论