python script to read and write json file