choix-spe/test.py

12 lines
275 B
Python
Raw Permalink Normal View History

2023-10-15 12:20:31 +00:00
import json
with open('data.json', 'r') as fichier:
donnees = json.load(fichier)
json_formate = json.dumps(donnees, indent=4)
# Écrire les données formatées dans un nouveau fichier
with open('data', 'w') as fichier_formate:
fichier_formate.write(json_formate)