Python
文章平均质量分 65
ShitChan
这个作者很懒,什么都没留下…
展开
-
简单爬虫
URL管理器实现方式:基于内存set()基于数据库(包含关系型如:oracle、mysql等,还有非关系型如:redis、pg等)包含属性:保存“爬”过的url保存未“爬”过的url包含方法:add增加一个urlget获取一个url网页下载器实现方式:urllib2urllib2.urlopen(url)request网页解析器实现方式:beautiful soupso原创 2017-02-08 17:30:37 · 203 阅读 · 0 评论 -
Python3.x和Python2.x的区别
Python3.x和Python2.x的区别1.性能 Py3.0运行 pystone benchmark的速度比Py2.5慢30%。Guido认为Py3.0有极大的优化空间,在字符串和整形操作上可 以取得很好的优化结果。 Py3.1性能比Py2.5慢15%,还有很大的提升空间。 2.编码 Py3.X源码文件默认使用utf-8编码,这就使得以下代码是合法的: >>>中国 = ‘china’转载 2017-01-30 15:29:18 · 192 阅读 · 0 评论 -
Python入门
list[]: items is changeable. append(item)\insert(index,item)\pop(). slip:[start,end,step]tuple(): items isn’t changeable.set([]): cannot repeat. remove(item)\add(item)dist{}: key-value. values(原创 2017-01-30 17:36:53 · 210 阅读 · 0 评论