/
githubmirror
/
LeetCodeAnimation
Обзор
Документация
Войти
/
githubmirror
/
LeetCodeAnimation
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
tools/anima/create.py
21 строка
661 B
吴师兄
docs: streamline repository root layout
10 июн 2026, 11:06
10 июн 2026, 11:06
e3001f4
Код
Авторство
О чём код?
import shutil from anima.base import get_project_path, get_md_template_path from anima.model import ProblemInfo, Solution def create_solution(problem_id: int, problem_title: str) -> None: problem = ProblemInfo(problem_id, problem_title) solution_dir = get_project_path() / problem.title_slug() if solution_dir.exists(): print(f'创建失败,文件夹 {solution_dir} 已存在') exit(1) solution_dir.mkdir() solution = Solution.create(problem, solution_dir) template = get_md_template_path() shutil.copy(template, solution.doc_path()) print(f'题解框架创建完毕,位于文件夹 {solution.path}')