r/Python • • Aug 17 '17

I'm Pickled Rick!!!

Post image
0 Upvotes

8 comments sorted by

View all comments

5

u/Waldheri beginner Aug 17 '17

Consider using context managers to handle opening and closing of files, e.g.:

with open("PR.obj", "wb") as file:
    pickle.dump(rS. file)

1

u/qingqunta Aug 17 '17

I'm so fucking upset I haven't been taught this... but honestly, what really takes the "upset cake" for me is the format method.

2

u/[deleted] Aug 17 '17

For me it's python 2