<分区> 分区>
我收到以下错误:
Traceback (most recent call last):
File "C:\Books\Python\gsearch.py", line 21, in <module>
text_file.write(titles)
File "C:\Program Files\Python 3.5\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u2190' in position 2936: character maps to <undefined>
行 text_file.write(titles) 应该将存储在 titles 变量中的一些文本写入文件。我读过其他问题,例如 this one在计算器上。但是,它们专门使用 print 处理控制台输出。我想将文本写入文件。
