Answers for "pickle python wb"

2

python pickle example

import pickle
favorite_color = { "lion": "yellow", "kitty": "red" }
with open( "save.p", "wb" ) as f:
	pickle.dump( favorite_color, f)
with open( "save.p", "rb" ) as f:
	favorite_color = pickle.load(f)
Posted by: Guest on September-21-2021

Python Answers by Framework

Browse Popular Code Answers by Language