安装pip
python -m ensurepip
pip3 install xxx
判断文本文件的字符编码
import chardet
filePath = "C:\\Users\\Administrator\\Desktop\\word.txt"
file = open(filePath ,‘rb’)
contents = file.read()
print(chardet.detect(contents ))
安装pip
python -m ensurepip
pip3 install xxx
判断文本文件的字符编码
import chardet
filePath = "C:\\Users\\Administrator\\Desktop\\word.txt"
file = open(filePath ,‘rb’)
contents = file.read()
print(chardet.detect(contents ))