solutions.json 파일을 분리해서 각각의 파일로 저장 (사용한 스크립트는 아래에 첨부)
app_sal.dataelement.DataElement 의 정답 코드 로드하는 부분 수정
README.txt 삭제
사용한 코드
import json
from pathlib import Path
path = Path('apps_sal/data/test') # 'apps_sal/data/train'
for prob in path.glob('*'):
solutions_json = prob / 'solutions.json'
if not solutions_json.exists():
print(f'A file {solutions_json} does not exists')
continue
solutions_dir = prob / 'solutions'
solutions_dir.mkdir(parents=True, exist_ok=True)
with solutions_json.open() as f:
solutions = json.load(f)
for i, solution in enumerate(solutions):
solution_py = solutions_dir / f'{i}.py'
with solution_py.open('w') as f:
print(solution, file=f)
solutions_json.unlink()
solutions.json
파일을 분리해서 각각의 파일로 저장 (사용한 스크립트는 아래에 첨부)app_sal.dataelement.DataElement
의 정답 코드 로드하는 부분 수정README.txt
삭제사용한 코드