10.1. Pickle AboutΒΆ

  • Serialization - writing (dumping) object to string

  • Deserialization - reading (loading) object from string

  • Used to save state to file or database and resume program later

  • User to exchange information between applications

  • Pickle - Python native serialization format

  • Pickle - supports protocols (compatibility with older versions)

  • Pickle - works almost only with Python-Python data exchange

  • pickle.load() -> load from file

  • pickle.loads() -> load from string (bytes)

  • pickle.dump() -> dump to file

  • pickle.dumps() -> dump to string (bytes)

  • What if name was pickle.from_file()?

  • What if name was pickle.from_text()?

  • What if name was pickle.to_file()?

  • What if name was pickle.to_text()?