(problem_id: int, problem_title: str)
| 5 | |
| 6 | |
| 7 | def create_solution(problem_id: int, problem_title: str) -> None: |
| 8 | problem = ProblemInfo(problem_id, problem_title) |
| 9 | solution_dir = get_project_path() / problem.title_slug() |
| 10 | |
| 11 | if solution_dir.exists(): |
| 12 | print(f'创建失败,文件夹 {solution_dir} 已存在') |
| 13 | exit(1) |
| 14 | solution_dir.mkdir() |
| 15 | |
| 16 | solution = Solution.create(problem, solution_dir) |
| 17 | |
| 18 | template = get_md_template_path() |
| 19 | shutil.copy(template, solution.doc_path()) |
| 20 | |
| 21 | print(f'题解框架创建完毕,位于文件夹 {solution.path}') |
| 22 |
no test coverage detected