python UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 2: ordinal not in range(128)错误解决办法
import sys
reload( sys )
sys.setdefaultencoding('utf-8')
在需要print的地方,前面加上u
print u'%-18s %-12s %s' % (truncate(entry.title.text.encode('UTF-8')),
entry.GetDocumentType(),
entry.resourceId.text)