# 将默认编码设为utf-8
# 否则会报错:
# UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
相关文章
- 03-31UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-3: ordinal not in range(128)
- 03-31UnicodeEncodeError: 'ascii' codec can't encode characters in position 2-5: ordin al not in range(128)——解决方案备注
- 03-31python:UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)
- 03-31解决 UnicodeEncodeError: 'ascii' codec can't encode characters in position 问题
- 03-31解决UnicodeEncodeError: ‘ascii’ codec can’t encode characters in position xxx ordinal not in range(128)
- 03-31Mac sublime 编译Python UnicodeEncodeError: 'ascii' codec can't encode characters in position 6-8: ordinal not in range(128)
- 03-31【python】UnicodeEncodeError: 'ascii' codec can't encode/decode characters
- 03-31python:UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xef in position xxx: ordinal not in range(128)
- 03-31python2.7 报错(UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 0: ordinal not in range(128))
- 03-31解决UnicodeEncodeError: 'ascii' codec can't encode characters in position