Files
olympic-discipline-quiz/get_data/get-events.py
Lennart J. Kurzweg (Nx2) 9d75757fec init
2024-08-16 19:28:51 +02:00

16 lines
367 B
Python

import subprocess
import json
with open("./sports.json", "r") as f:
sports = json.load(f)
ret = {}
for sport in sports:
stdout = subprocess.check_output(f'./get-events.sh {sport}', shell=True)
events = json.loads(stdout)
ret[sport] = events
with open("./events.json", "w") as f:
json.dump(ret, f, indent=4, ensure_ascii=False, sort_keys=True)