为csv outpu编码特殊字符python

2024-10-04 09:31:03 发布

您现在位置:Python中文网/ 问答频道 /正文

我怎样才能让csv.writer.writerow输出áorè和其他特殊字符,比如u,n?在

我有个错误 UnicodeEncodeError:“ascii”编解码器无法对位置37中的字符u'\xed'进行编码:序号不在范围(128)

已经尝试了this文章中的一些建议,但没有成功

rowPrinter = []

while x < y:
     print "Data in at Line " + str(x + 1)
     rowPrinter.append([a[x], b[x], c[x]]])
     x = x + 1   

x=0

^{pr2}$

Tags: orcsv编码错误编解码器asciithis字符