1import pickle #credits to stack overflow user= blender
2
3a = {'hello': 'world'}
4
5with open('filename.pkl', 'wb') as handle:
6 pickle.dump(a, handle, protocol=pickle.HIGHEST_PROTOCOL)
7
8with open('filename.pkl', 'rb') as handle:
9 b = pickle.load(handle)
10
11print (a == b)
1import pickle
2file_name='my_file.pkl'
3f = open(file_name,'wb')
4pickle.dump(my_data,f)
5f.close()