Pickle
Utilisation basique
import pickle import os data = None if os.path.exists("data.pickle"): with open("data.pickle", "rb") as f: data = pickle.load(f) else: data = [1, 2, 3, 4] with open("data.pickle", "wb") as f: pickle.dump(data, f)
python:pickle
import pickle import os data = None if os.path.exists("data.pickle"): with open("data.pickle", "rb") as f: data = pickle.load(f) else: data = [1, 2, 3, 4] with open("data.pickle", "wb") as f: pickle.dump(data, f)