import json import time FILE="lliurex_actions.json" t=int(time.time()) with open(FILE) as f: data=json.load(f) print(data) data["last_update"]=t print(data) new_data=json.dumps(data,indent=4,ensure_ascii=False) with open(FILE,"w") as f: f.write(new_data)