import chardet
file = r"C:\Users\顾李飞\Desktop\file3.txt" # " "内输入对应文件的路径
with open(file, "rb") as f:
print(chardet.detect(f.read())["encoding"])
python文件编码格式如何查找
最新推荐文章于 2020-11-25 23:19:28 发布
import chardet
file = r"C:\Users\顾李飞\Desktop\file3.txt" # " "内输入对应文件的路径
with open(file, "rb") as f:
print(chardet.detect(f.read())["encoding"])