python如何查看编码类型

python查看编码类型的方法:1、输入“import chardet”命令导入模块;2、输入“chardit=chardet.detect(c)”命令查看编码(c为要查看的编码),输出后的结果即为要查看的编码类型。

python如何查看编码类型

查看编码类型

importchardet
chardit1=chardet.detect(cf_r)#cf_r为要查看的编码
print(cf_r['encoding'])