Last active
January 9, 2023 15:21
-
-
Save thomasweng15/73c7504f38b9637a6d65ad7486896340 to your computer and use it in GitHub Desktop.
edit a pickle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# best run in an interpreter or with a breakpoint | |
import pickle | |
fn = '' | |
with open(fn, 'rb') as f: | |
a = pickle.load(f) | |
# make edits | |
# breakpoint() | |
# a = a[:len(a)-1] | |
pickle.dump(a, open(fn, 'wb')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment