标签:编码解码 mode 解码 int port 文件 res encoding adl
import chardet
raw = open("model.json", ‘rb‘).read()
result = chardet.detect(raw)
# 检测编码
encoding = result[‘encoding‘]
f = open("model.json", "r", encoding=encoding)
lines = f.readlines()
for line in lines:
print(line)
标签:编码解码 mode 解码 int port 文件 res encoding adl
原文地址:https://www.cnblogs.com/Py00/p/8881850.html