python 基础
一直在路上ha~
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
使用多进程,多线程和协程实现爬虫,使用queue完成数据通信
一直在看python的多进程,多线程和协程,动手试了试写个爬虫练习一下。多线程版本 import sslimport threadingimport timeimport urllib.requestfrom queue import Queuefrom lxml import etreeclass myThread(threading.Thread): def ...原创 2019-02-26 17:00:14 · 731 阅读 · 0 评论 -
Python进阶--生成器和迭代器以及实现方法
生成器和迭代器 generator: ⽣成器是一种特殊的迭代器, 不需要⾃定义 __iter__ 和 __next__ ⽣成器函数 (yield)def foo(): ...: print(111) ...: yield 222 ...: print(333) ...: yield 444 ...: p...原创 2019-02-26 18:26:19 · 269 阅读 · 0 评论
分享