将字符串写入文本时出现解决UnicodeEncodeError: 'ascii' codec can't encode characters in position
解决办法:
在开头加上
import sys
reload(sys)
sys.setdefaultencoding( "utf-8" )