Skip to content

Instantly share code, notes, and snippets.

@Farrukhraz
Last active May 21, 2020 09:55
Show Gist options
  • Save Farrukhraz/22a8b89d7ebb8960456fbd87107a5993 to your computer and use it in GitHub Desktop.
Save Farrukhraz/22a8b89d7ebb8960456fbd87107a5993 to your computer and use it in GitHub Desktop.
Object to binary file and reverse
import pickle
with open('data.pickle', 'wb') as f:
pickle.dump(old_data, f, pickle.HIGHEST_PROTOCOL)
with open(r'C:\path\to\file.pkl', 'rb') as f:
new_data = pickle.load(f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment