Python学习
s89QL
这个作者很懒,什么都没留下…
展开
-
百度贴吧自动图片下载爬虫
# -*- coding: utf-8 -*- url = 'http://tieba.baidu.com/p/2970106602' neo_headers = ['Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.94 Safari/537.原创 2015-10-10 21:27:44 · 835 阅读 · 0 评论 -
Python base64模块
import base64 import StringIO a = "this is a test" b = base64.encodestring(a) print b print base64.decodestring(b) c = StringIO.StringIO() c.write(a) d = StringIO.StringIO() e = StringI原创 2015-10-10 21:29:33 · 548 阅读 · 0 评论 -
windows下 pip的更新升级
pip是python官方推荐的,在2.7.9版本后,已经集成pip,然而在使用pycharm时,出现了无法升级pip的情况:查阅官方文档:python -m pip install -U pip即可更新pip到最新原创 2016-03-08 21:00:11 · 3084 阅读 · 0 评论 -
Python json库使用中文时乱码
在使用如下方法时,中文会乱码json.dumps()是因为会自动转码为ascii,就会出现编码问题,这个问题在python3中也会遇到。 解决方法是: json.dumps(list,ensure_ascii=False)原创 2016-11-01 10:48:13 · 625 阅读 · 0 评论