📅  最后修改于: 2022-03-11 15:02:05.260000             🧑  作者: Mango
with open('file.json', 'r+') as file:
content = file.read()
file.seek(0)
content.replace('string_replaced', 'new_string')
file.write(content)