import json from pathlib import Path Path('/root/results').mkdir(parents=True, exist_ok=True) Path('/root/results/answers.json').write_text('[]')