![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
个人成长
文章平均质量分 85
solodom
这个作者很懒,什么都没留下…
展开
-
crawler(2)
Contents设置代理异常处理Cookies图片爬虫实战re.findall()链接爬虫糗事百科爬虫设置代理from urllib import requestdef use_proxy(proxy_adrr,url): """ this function use a proxy to open a webpage args: proxy_a...原创 2018-12-30 15:55:27 · 549 阅读 · 0 评论 -
machine learning---kNN(1)
创建测试数据集import numpy as np # import everything from numpyimport operator # operator moduledef createDataSet(): # there are two [] for array group=np.array([[1.0,1.1],[1.0,1.0],[0,0],[0,0.1...原创 2018-12-13 22:37:44 · 214 阅读 · 0 评论 -
python basics--装饰器
contents装饰器最简单的装饰器目标函数带参数的装饰器目标函数带有不固定参数的装饰器装饰器带参数装饰器装饰器用于动态地为函数扩展功能,同时不改变原本的函数定义最简单的装饰器import timedef decorator(fun): def wrapper(): start=time.time() fun() runtime...原创 2018-12-13 13:22:48 · 107 阅读 · 0 评论 -
crawler(1)
Contentshttp get 请求http post 请求http get 请求# 利用get请求获取相应网页,并以html形式存储from urllib import requesturl='http://www.baidu.com/s?ie=utf-8&f=8&rsv_bp=1&tn=baidu&wd='keyword='你好'# 利用requ...原创 2018-12-05 09:05:43 · 166 阅读 · 0 评论 -
python basics(9)--- The Standard Library: A Few Favorites
Contents1. sys(1) sys.argv(2) sys.modules(3) sys.path(4) sys.platform(5) sys.stdin, sys.stdout, sys.stderr2. Heaps3. Deques1. sys(1) sys.argvsys.argv : it is a list containing the command argument...原创 2018-11-14 14:35:53 · 144 阅读 · 0 评论