The main tools that is suitable for you approach is pickle
. It is native in Python and is a serialization method for all Python objects. See docs. The main problem with pickle
is if you use it to save objects that holds a large amount of data. It will save the whole object and hence large files.
Alternative approaches are also very welcome and preferred when planning and implementing using a design pattern that is suitable for the job.
For instance, you can build configuration objects that tracks the work and save it into JSON
formats.
Another language that is good for preferences and state capturing is XML
.
However, in all the designed approaches you'll need to modify the code such that it can save and resume based on the defined settings, state and preferences.
All the above languages have libraries to support it, JSON
is native.