pickle 基础用法

def save_obj_to_file(path, target_obj):
    file = open(path,'wb')
    pickle.dump(target_obj)
    file.close()

def load_obj_from_file(path):
    file = open(path,'rb')
    return pickle.load(file)
原文地址:https://www.cnblogs.com/yaolin1228/p/9442506.html