python读取pkl格式文件
程序员文章站
2022-05-28 15:35:05
...
def load_cache(path, encoding="latin-1", fix_imports=True):
with open(path, "rb") as f:
return pickle.load(f, encoding=encoding, fix_imports=True)
# 这里encoding是编码格式,要根据具体的pkl文件来选择