12 lines
275 B
Python
12 lines
275 B
Python
|
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)
|
||
|
|