[python] Use dat file to store and share persistent data