mirror of
https://forge.chapril.org/tykayn/wololo
synced 2025-10-09 17:02:46 +02:00
réinit
This commit is contained in:
commit
996524bc6d
107 changed files with 1295536 additions and 0 deletions
29
etalab_data/gynadco/gather_html.py
Normal file
29
etalab_data/gynadco/gather_html.py
Normal file
|
@ -0,0 +1,29 @@
|
|||
import os
|
||||
import json
|
||||
|
||||
# Liste des fichiers JSON à traiter
|
||||
json_files = [f"out_250_{i}.json" for i in range(1, 16)]
|
||||
|
||||
# Ouvre le fichier list.html en écriture
|
||||
with open("list.html", "w", encoding="utf-8") as f_list:
|
||||
|
||||
# Pour chaque fichier JSON
|
||||
for json_file in json_files:
|
||||
|
||||
# Vérifie si le fichier existe
|
||||
if os.path.exists(json_file):
|
||||
|
||||
# Ouvre le fichier JSON en lecture
|
||||
with open(json_file, "r", encoding="utf-8") as f_json:
|
||||
|
||||
# Charge le contenu JSON
|
||||
data = json.load(f_json)
|
||||
|
||||
# Récupère la propriété "html"
|
||||
html_content = data["html"]
|
||||
|
||||
# Écrit le contenu HTML dans le fichier list.html
|
||||
f_list.write(html_content)
|
||||
|
||||
else:
|
||||
print(f"Le fichier {json_file} n'existe pas.")
|
Loading…
Add table
Add a link
Reference in a new issue