Skip to content

Commit

Permalink
Add script (new_prob.py) to create problem skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
Bogay committed Feb 22, 2020
1 parent 1dd87d0 commit cee434a
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions new_prob.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import sys
import json
from pathlib import Path

if __name__ == '__main__':
if len(sys.argv) != 2:
print(f'Usage: python {__file__} <problem_name>')
exit(0)
problem_name = sys.argv[1]
problem_root = Path('problem')
problem_dir = problem_root / problem_name
problem_dir.mkdir()
(problem_dir / 'src').mkdir()
(problem_dir / 'testcase').mkdir()
meta = problem_dir / 'meta.json'
json.dump({
'language': 0,
'tasks': [],
}, meta.open('w'))

0 comments on commit cee434a

Please sign in to comment.