import json with open('fichero.json') as f: datos = json.load(f)
import json datos = { ... } with open('fichero.json', 'w') as f: json.dump(datos, f) #json.dump(datos, f, indent=4) # Guardar identado