PyDocs

Nav

Data Persistence

open

shelve

function (source)
  • open(filename, flag='c', protocol=None, writeback=False, *, serializer=None, deserializer=None)
Open a persistent dictionary for reading and writing.

The filename parameter is the base filename for the underlying
database.  As a side-effect, an extension may be added to the
filename and more than one file may be created.  The optional flag
parameter has the same interpretation as the flag parameter of
dbm.open(). The optional protocol parameter specifies the
version of the pickle protocol.

See the module's __doc__ string for an overview of the interface.
Changed in 3.10, 3.11, 3.15
  • 3.10: pickle.DEFAULT_PROTOCOL is now used as the default pickle protocol.
  • 3.11: Accepts path-like object for filename.
  • 3.15: Accepts custom serializer and deserializer functions in place of pickle.dumps() and pickle.loads().
0 Examples
No examples for shelve/open.
See Also
No see-alsos for shelve/open
0 Notes
No notes for open