📜  pkl 保存多个文件 - Python 代码示例

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

代码示例1
# Using a list, tuple, or dict is by far the most common way to do this:

import pickle
PIK = "pickle.dat"

data = ["A", "b", "C", "d"]
with open(PIK, "wb") as f:
    pickle.dump(data, f)
    
with open(PIK, "rb") as f:
    print pickle.load(f)