Answers for "pickle.dump example python 3"

5

pickle save

import pickle

pickle.dump( favorite_color, open( "save.p", "wb" ) )
favorite_color = pickle.load( open( "save.p", "rb" ) )
Posted by: Guest on October-05-2020
3

pickle dump

import pickle
with open('Fruits.obj', 'wb') as fp:
	pickle.dump(banana, fp)
Posted by: Guest on January-13-2021
4

create pickle file python

import pickle
file_name='my_file.pkl'
f = open(file_name,'wb')
pickle.dump(my_data,f)
f.close()
Posted by: Guest on April-01-2020

Python Answers by Framework

Browse Popular Code Answers by Language