Unicode字符串转换为人类可读格式

时间:2020-03-26 03:45:09

标签: python python-3.x

我正在尝试打印unicode字符串,但是它失败并显示消息

File "C:\Python\Python37-32\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]

UnicodeEncodeError:'charmap'编解码器无法在位置0-10处编码字符:字符映射到

我正在使用utf-8编码读取文件

with open(filename,'r',encoding='utf-8') as f:

我很困惑这个问题。

每当我使用用户记录器时,它都会直接转储数据,但是打印时出现问题

我正在使用mpi4py执行。 enter image description here

这是有问题的语言

enter image description here

with open(filename,'r',encoding='utf-8') as f:
next(f)
next(f)
//logic to extract hashtags from tweets and send to different processes using mpi

// code to gather the tweets from various processes and print

0 个答案:

没有答案
相关问题