what is pickle.dump in python code example
Example 1: pickle dump
import pickle
with open('Fruits.obj', 'wb') as fp:
pickle.dump(banana, fp)
Example 2: pickle python
1 # Save a dictionary into a pickle file.
2 import pickle
3
4 favorite_color = { "lion": "yellow", "kitty": "red" }
5
6 pickle.dump( favorite_color, open( "save.p", "wb" ) )