摘要: 在上一节我们回顾了python 多线程的知识。queue这个线程安全的序列正是python用来实现线程池的关键。我们可以把爬虫需要解析的URL放入这个序列中,供其它空闲的线程获取并使用。线程池的实现:import ThreadPool.dlthreadclass threadpool: def... 阅读全文
posted @ 2013-06-29 22:07 爱知菜 阅读(199) 评论(0) 推荐(0) 编辑