文章分类 -  Python

python中除空格,换行符,制表符
摘要:s=u'\n [\u7b2c44\u96c6]\n 'print "".join(s.split()) 阅读全文
posted @ 2014-05-05 19:06 卡域克 阅读(338) 评论(0) 推荐(0)
UnicodeDecodeError: ‘XXX' codec can't decode bytes in position 2-5: illegal multibyte sequence
摘要:这个是编码格式错误 多试几个格式#!/usr/bin/env python#-*- coding: gb18030 -*- from urllib2 import urlopen import re#网易公开课 下载地址抓取url='http://v.163.com/special/Khan/ar... 阅读全文
posted @ 2014-05-04 10:13 卡域克 阅读(265) 评论(0) 推荐(0)
python3 stdin 指定编码
摘要:import ioimport sysinput_stream = io.TextIOWrapper(sys.stdin.buffer, encoding='utf-8')链接 阅读全文
posted @ 2013-11-30 14:06 卡域克 阅读(708) 评论(0) 推荐(0)