📜  python 将字典保存到文件 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:46.127000             🧑  作者: Mango

代码示例4
with open('saved_dictionary.pkl', 'wb') as f:
    pickle.dump(dictionary, f)
        
with open('saved_dictionary.pkl', 'rb') as f:
        loaded_dict = pickle.load(f)