Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pickle
- data = {
- i: str(10000 - i) for i in range(10000)
- }
- data[1] = [chr(i) for i in range(127)]
- with open('data1.pickle', 'wb') as file:
- pickle.dump(data, file, protocol=None)
- with open('data2.pickle', 'wb') as file:
- pickle.dump(data, file, protocol=4)
- $ ls -sh *.pickle
- 168K data1.pickle 100K data2.pickle
Add Comment
Please, Sign In to add comment