python读取pkl格式文件

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文件来选择

 

你可能感兴趣的:(python)