Answers for "pkl save multiple files"

0

pkl save multiple files

# 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)
Posted by: Guest on July-26-2021

Python Answers by Framework

Browse Popular Code Answers by Language