报错位置: f.write(title+','+link+'\n')
UnicodeEncodeError: 'gbk' codec can't encode character '\u30fb' in position 5: illegal multibyte sequence
解决办法:f = open('1.txt','w+',encoding='utf-8'),添加encoding编码为非默认
报错位置: f.write(title+','+link+'\n')
UnicodeEncodeError: 'gbk' codec can't encode character '\u30fb' in position 5: illegal multibyte sequence
解决办法:f = open('1.txt','w+',encoding='utf-8'),添加encoding编码为非默认
本文标题:python编码报错1
本文链接:https://www.haomeiwen.com/subject/yjwbsftx.html
网友评论