摘要: 在pandas用read_csv时,遇到编码错误的, 可带 encoding : str, default None Encoding to use for UTF when reading/writing (ex. ‘utf-8’) Encoding to use for UTF when rea 阅读全文
posted @ 2016-11-29 13:18 stephen2016 阅读(3638) 评论(0) 推荐(0) 编辑
摘要: 用python+bs4爬取了手机归属地数据: import urllib.request from bs4 import BeautifulSoup def spider1(url): headers = {'User-Agent':'Mozilla/5.0 (Windows NT 6.1) App 阅读全文
posted @ 2016-11-25 16:02 stephen2016 阅读(1367) 评论(0) 推荐(0) 编辑
摘要: 解决命令行的乱码以及编码的问题 命令 chcp 功能: 显示或设置活动代码页编号 CHCP [nnn] nnn 指定代码页编号。 不加参数键入 CHCP 显示活动代码页编号。 nnn指定一已有的系统字符集,该字符集在CONFIG.SYS文件中由COUNTRY命令定义。 在DOS下可以通过mode命令 阅读全文
posted @ 2016-11-24 14:57 stephen2016 阅读(3574) 评论(0) 推荐(0) 编辑
摘要: 用CMD测试代码的时候,因为CMD默认用gbk支持print(),当UTF字符集出现超出GBK编码的字符是就会出现: UnicodeEncodeError: ‘gbk’ codec can’t encode character u’\u200e’ in position 43: illegal mu 阅读全文
posted @ 2016-10-27 17:43 stephen2016 阅读(276) 评论(0) 推荐(0) 编辑
摘要: 用PYTHON关闭显示器很方便,网上找的代码,保存为PY,直接运行即可。 阅读全文
posted @ 2016-10-25 13:14 stephen2016 阅读(752) 评论(0) 推荐(0) 编辑
摘要: 解压: 设定 PATH 以及 GOROOT: 验证: 阅读全文
posted @ 2016-10-16 17:55 stephen2016 阅读(303) 评论(0) 推荐(0) 编辑
摘要: 在 pip install GeoIP是收到如下错误提示: error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat). 解决方案就是安装VISUAL STUDIO 2010. 阅读全文
posted @ 2016-10-11 15:28 stephen2016 阅读(76) 评论(0) 推荐(0) 编辑
摘要: 在python 2.7里 print是表达式,使用双引号打印字符串。 而在python 3.4里 print是函数,使用括号打印字符串。 阅读全文
posted @ 2016-10-09 16:20 stephen2016 阅读(173) 评论(0) 推荐(0) 编辑