2016年11月28日

摘要: from lxml import etreeimport requestsdef getHtml(html): novelcontent = requests.get(html).content return etree.HTML(novelcontent)source = getHtml("htt 阅读全文
posted @ 2016-11-28 19:39 chinxfin 阅读(241) 评论(0) 推荐(0) 编辑
摘要: #-*-coding:utf-8-*-from lxml import etreeimport requestsfrom urllib import urlretrieveimport osdef getHtml(html): novelcontent = requests.get(html).co 阅读全文
posted @ 2016-11-28 19:38 chinxfin 阅读(322) 评论(0) 推荐(0) 编辑

2016年11月27日

摘要: 将 PIL 安装目录下的 ImageShow.py 文件的第 99 行:(我的 Python 安装在 D:\Program Files\python 2.6,那 ImageShow.py 文件在:D:\Program Files\python 2.6\Lib\site-packages\PIL\Im 阅读全文
posted @ 2016-11-27 11:32 chinxfin 阅读(412) 评论(0) 推荐(0) 编辑

2016年11月26日

摘要: from lxml import etreeimport requestsdef getHtml(html): novelcontent = requests.get(html).content return etree.HTML(novelcontent)source = getHtml("htt 阅读全文
posted @ 2016-11-26 02:02 chinxfin 阅读(754) 评论(0) 推荐(0) 编辑

2016年11月25日

摘要: from lxml import etreeimport requestsdef getHtml(html): novelcontent = requests.get(html).content return etree.HTML(novelcontent)source = getHtml("htt 阅读全文
posted @ 2016-11-25 19:53 chinxfin 阅读(130) 评论(0) 推荐(0) 编辑

2016年11月22日

摘要: from BaseHTTPServer import BaseHTTPRequestHandler 阅读全文
posted @ 2016-11-22 13:53 chinxfin 阅读(80) 评论(0) 推荐(0) 编辑

2016年11月12日

摘要: django-admin startproject project-name 启动服务器 python manage.py runserver 0.0.0.0:8000 配置ALLOW_HOST 阅读全文
posted @ 2016-11-12 16:38 chinxfin 阅读(76) 评论(0) 推荐(0) 编辑

2016年11月7日

摘要: NameError: name 'pip' is not defined 直接去cmd下执行。。。pip pip install virtualenv 阅读全文
posted @ 2016-11-07 20:20 chinxfin 阅读(622) 评论(0) 推荐(0) 编辑

2016年11月1日

摘要: 使用try...except捕获错误还有一个巨大的好处,就是可以跨越多层调用,比如函数main()调用foo(),foo()调用bar(),结果bar()出错了,这时,只要main()捕获到了,就可以处理; 不需要在每个可能出错的地方去捕获错误,只要在合适的层次去捕获错误就可以了。这样一来,就大大减 阅读全文
posted @ 2016-11-01 19:55 chinxfin 阅读(108) 评论(0) 推荐(0) 编辑

2016年10月31日

摘要: Python内置的@property装饰器就是负责把一个方法变成属性调用的 阅读全文
posted @ 2016-10-31 10:04 chinxfin 阅读(81) 评论(0) 推荐(0) 编辑

导航