Python: Save and Load Pickle File
作者:XD / 发表: 2023年2月28日 06:56 / 更新: 2023年2月28日 06:56 / 编程笔记 / 阅读量:1043
Python: Save and Load Pickle File.
import pickle
save_dict = {'id': 110}
with open('save_path_here.pickle', 'wb') as handle:
pickle.dump(save_dict, handle, protocol=pickle.HIGHEST_PROTOCOL)
with open('save_path_here.pickle', 'rb') as handle:
load_dict = pickle.load(handle)
print(save_dict== load_dict)