Python LanguagePython Persistence

Syntax

  • pickle.dump(obj, file, protocol=None, *, fix_imports=True)

  • pickle.load(file, *, fix_imports=True, encoding="ASCII", errors="strict")

Parameters

ParameterDetails
objpickled representation of obj to the open file object file
protocolan integer, tells the pickler to use the given protocol,0-ASCII, 1- old binary format
fileThe file argument must have a write() method wb for dump method and for loading read() method rb

Related Examples

Function utility for save and load