replace json file python code example
Example: replace json data python
with open('file.json', 'r+') as file:
content = file.read()
file.seek(0)
content.replace('string_replaced', 'new_string')
file.write(content)
with open('file.json', 'r+') as file:
content = file.read()
file.seek(0)
content.replace('string_replaced', 'new_string')
file.write(content)