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))
1.4m articles
1.4m replys
5 comments
57.0k users