Guest User

Untitled

a guest
Dec 15th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. import pickle
  2.  
  3. data = {
  4. i: str(10000 - i) for i in range(10000)
  5. }
  6.  
  7. data[1] = [chr(i) for i in range(127)]
  8.  
  9. with open('data1.pickle', 'wb') as file:
  10. pickle.dump(data, file, protocol=None)
  11.  
  12. with open('data2.pickle', 'wb') as file:
  13. pickle.dump(data, file, protocol=4)
  14.  
  15. $ ls -sh *.pickle
  16. 168K data1.pickle 100K data2.pickle
Add Comment
Please, Sign In to add comment