Jul-05-2023, 02:02 AM
(This post was last modified: Jul-05-2023, 02:02 AM by deanhystad.)
Saving data using shelve, pickle, or json all pretty much work the same way. When you start your program you will read your archived data from a file (in shelve and pickle it will be binary, in json it will be text). When you change something that needs to be persisted, you write the file. Any way you do it you end up with a file that you need to load and update.
I prefer json over pickle or shelve. The file is human readable, and it is really fast. Pickle and shelve allow writing a wider range of types, but I don't often that to be much benefit. Most of the things you save willb e strings, ints or floats, and jsot works fine with thos.
You should post your code and describe what you are trying to save.
I prefer json over pickle or shelve. The file is human readable, and it is really fast. Pickle and shelve allow writing a wider range of types, but I don't often that to be much benefit. Most of the things you save willb e strings, ints or floats, and jsot works fine with thos.
You should post your code and describe what you are trying to save.