Need to rename value inside json files. example: [somefilename123.json]
[somefilename123.json]
{"Real/Fake": "Fake", "Fake source": "Print", "Fake Type": "PrintFolded"}
Need to rename value "Print" to "PrintCut"
"Print"
"PrintCut"
import json with open("some_file.json",'r') as f: dict_obj = json.loads(f.read()) dict_obj["Fake source"] = "PrintCut" with open("some_file.json", "w+") as f: f.write(json.dumps(dict_obj, indent = 4))
2.1m questions
2.1m answers
60 comments
57.0k users