Best way to save complex Python data structures across program sessions (pickle, json, xml, database, other) Best way to save complex Python data structures across program sessions (pickle, json, xml, database, other) json json

Best way to save complex Python data structures across program sessions (pickle, json, xml, database, other)


You have a misconception about pickles: they are guaranteed to work across Python versions. You simply have to choose a protocol version that is supported by all the Python versions you care about.

The technique you left out is marshal, which is not guaranteed to work across Python versions (and btw, is how .pyc files are written).