Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
CSDN 技术社区
skill_tree_algorithm
提交
1b4289bc
S
skill_tree_algorithm
项目概览
CSDN 技术社区
/
skill_tree_algorithm
通知
9
Star
8
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
skill_tree_algorithm
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
1b4289bc
编写于
11月 12, 2021
作者:
每日一练社区
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add template for lanqiao
上级
818a0c07
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
28 addition
and
1 deletion
+28
-1
leetcode_helper.py
leetcode_helper.py
+28
-1
未找到文件。
leetcode_helper.py
浏览文件 @
1b4289bc
...
...
@@ -467,6 +467,33 @@ def add_color_for_special_exercises():
def
add_solution_md_template_for_lanqiao
():
data_dir
=
'data_backup/3.蓝桥杯'
dirs_
=
os
.
listdir
(
data_dir
)
dirs
=
[]
for
dir
in
dirs_
:
dir
=
os
.
path
.
join
(
data_dir
,
dir
)
if
os
.
path
.
isdir
(
dir
):
dirs
.
append
(
dir
)
for
dir
in
dirs
:
assert
os
.
path
.
isdir
(
dir
)
solution_md_path
=
os
.
path
.
join
(
dir
,
'solution.md'
)
if
not
os
.
path
.
exists
(
solution_md_path
):
template_path
=
'lanqiao_template.md'
title
=
dir
.
split
(
'/'
)[
-
1
].
split
(
'.'
)[
-
1
]
desc_path
=
os
.
path
.
join
(
dir
,
'desc.md'
)
with
open
(
desc_path
,
'r'
,
encoding
=
'utf-8'
)
as
f
:
desc_data
=
f
.
read
()
with
open
(
template_path
,
'r'
,
encoding
=
'utf-8'
)
as
f
:
template_data
=
f
.
read
()
template_data
=
template_data
.
replace
(
'# 两数之和
\n
'
,
'# {}
\n\n
{}'
.
format
(
title
,
desc_data
))
print
(
template_data
)
with
open
(
solution_md_path
,
'w'
,
encoding
=
'utf-8'
)
as
f
:
f
.
write
(
template_data
)
...
...
@@ -479,7 +506,7 @@ if helper_function == 'modify_back_up_dir_name':
add_
color_for_special_exercises
()
add_
solution_md_template_for_lanqiao
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录