python如何查看编码类型

Python (197) 2023-04-14 06:14:01

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

查看编码类型

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

推荐课程:Python 基础入门教程

THE END

发表回复