I want to save configuration of an application written in Python 2 to a file (I have to choose the file format, JSON, SQL, Pickle...).
I know this is a simple task, but I want to do it reliably. I'd like to save two identical copies of the file, check the integrity of the main file and, if needed (main is corrupted), load data from the aux file.
However I don't know how to check the integrity of a file. Any suggestion?