Advertisement
Guest User

Untitled

a guest
Jul 14th, 2020
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.19 KB | None | 0 0
  1. # Save object
  2. import pickle  
  3. f = open("/tmp/a.pkl", "wb")
  4. pickle.dump(obj, f, pickle.HIGHEST_PROTOCOL)
  5. f.close()
  6.  
  7. # Load object
  8. f = open("/tmp/a.pkl", "rb")
  9. obj = pickle.load(f)
  10. f.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement