Back
Try the Following code:
import picklea = {'hello': 'world'}with open('filename.pickle', 'wb') as handle: pickle.dump(a, handle, protocol=pickle.HIGHEST_PROTOCOL)with open('filename.pickle', 'rb') as handle: b = pickle.load(handle)print a == b
import pickle
a = {'hello': 'world'}
with open('filename.pickle', 'wb') as handle:
pickle.dump(a, handle, protocol=pickle.HIGHEST_PROTOCOL)
with open('filename.pickle', 'rb') as handle:
b = pickle.load(handle)
print a == b
Want to become a expert in Python? Join the python course fast!
For more details, do check out the below video tutorial...
31k questions
32.8k answers
501 comments
693 users