Skip to content

Commit 3b89315

Browse files
committed
update script usage readme
1 parent f92b6b0 commit 3b89315

File tree

7 files changed

+198
-72
lines changed

7 files changed

+198
-72
lines changed

.gitignore

+110
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
data
2+
3+
# Byte-compiled / optimized / DLL files
4+
__pycache__/
5+
*.py[cod]
6+
*$py.class
7+
8+
# Editor directories and files
9+
.idea
10+
.vscode
11+
12+
# C extensions
13+
*.so
14+
15+
# Distribution / packaging
16+
.Python
17+
build/
18+
develop-eggs/
19+
dist/
20+
downloads/
21+
eggs/
22+
.eggs/
23+
lib/
24+
lib64/
25+
parts/
26+
sdist/
27+
var/
28+
wheels/
29+
*.egg-info/
30+
.installed.cfg
31+
*.egg
32+
MANIFEST
33+
34+
# PyInstaller
35+
# Usually these files are written by a python script from a template
36+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
37+
*.manifest
38+
*.spec
39+
40+
# Installer logs
41+
pip-log.txt
42+
pip-delete-this-directory.txt
43+
44+
# Unit test / coverage reports
45+
htmlcov/
46+
.tox/
47+
.coverage
48+
.coverage.*
49+
.cache
50+
nosetests.xml
51+
coverage.xml
52+
*.cover
53+
.hypothesis/
54+
55+
# Translations
56+
*.mo
57+
*.pot
58+
59+
# Django stuff:
60+
*.log
61+
.static_storage/
62+
.media/
63+
local_settings.py
64+
65+
# Flask stuff:
66+
instance/
67+
.webassets-cache
68+
69+
# Scrapy stuff:
70+
.scrapy
71+
72+
# Sphinx documentation
73+
docs/_build/
74+
75+
# PyBuilder
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# pyenv
82+
.python-version
83+
84+
# celery beat schedule file
85+
celerybeat-schedule
86+
87+
# SageMath parsed files
88+
*.sage.py
89+
90+
# Environments
91+
.env
92+
.venv
93+
env/
94+
venv/
95+
ENV/
96+
env.bak/
97+
venv.bak/
98+
99+
# Spyder project settings
100+
.spyderproject
101+
.spyproject
102+
103+
# Rope project settings
104+
.ropeproject
105+
106+
# mkdocs documentation
107+
/site
108+
109+
# mypy
110+
.mypy_cache/

README.md

+61-61
Large diffs are not rendered by default.

scripts/1.png

69.3 KB
Loading

scripts/2.png

15.2 KB
Loading

scripts/3.png

70.4 KB
Loading

scripts/readme.md

+22-6
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,33 @@
11
## 脚本使用方法
2-
首先需要安装requests这个库,如果没有安装,请使用下面这个命令
2+
首先,需要安装`requests`这个库,如果没有安装,请使用下面这个命令
33
```
44
pip install requests
55
```
6-
然后打开该文件,在`Config`类中配置自己的路径,有两个地方需要配置。
7-
`local_path``github_leetcode_url`
8-
`local_path`是你本地保存github仓库中的路径
9-
`github_leetcode_url`是你github上解题结果的路径。
6+
然后,打开该文件,在`Config`类中配置自己的路径,有两个地方需要配置。
7+
`local_path``github_leetcode_url`,如下图:
8+
![](1.png)
109

11-
然后只需要运行该脚本就好了
10+
11+
12+
13+
- local_path`是你本地保存github仓库中的路径,如图:
14+
15+
![](2.png)
16+
17+
18+
19+
20+
21+
22+
- `github_leetcode_url`是你github上解题结果的路径,如图:
23+
![](3.png)
24+
25+
26+
然后只需要在对应目录下面使用下面命令运行该脚本就好了
1227
```
1328
python readme.py
1429
```
30+
1531
首次创建就运行上面的脚本。
1632

1733
更新就把对应题目的解答放到相对于文件夹下面,然后运行该脚本。

scripts/readme.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def update_table(self, oj):
127127
folder_url = os.path.join(folder_url, item)
128128
folder_url = os.path.join(Config.github_leetcode_url, folder_url)
129129
# print(folder_url)
130-
self.table_item[folder[:3]].python = '[python]({})'.format(folder_url)
130+
self.table_item[folder[:3]].python = '[Python]({})'.format(folder_url)
131131
elif item.endswith('.java'):
132132
complete_info.solved['java'] += 1
133133
folder_url = folder.replace(' ', "%20")
@@ -230,10 +230,10 @@ def create_leetcode_readme(self, table_instance):
230230
'id': item.id_,
231231
'title': '[{}]({}) {}'.format(item.title, item.url, _lock),
232232
'difficulty': item.difficulty,
233-
'js': '[JavaScript]({})'.format(item.javascript) if item.javascript else 'To Do',
234-
'python': '[Python]({})'.format(item.python) if item.python else 'To Do',
235-
'c++': '[C++]({})'.format(item.c_plus_plus) if item.c_plus_plus else 'To Do',
236-
'java': '[Java]({})'.format(item.java) if item.java else 'To Do'
233+
'js': item.javascript if item.javascript else 'To Do',
234+
'python': item.python if item.python else 'To Do',
235+
'c++': item.c_plus_plus if item.c_plus_plus else 'To Do',
236+
'java': item.java if item.java else 'To Do'
237237
}
238238
line = '|{id}|{title}|{difficulty}|{js}|{python}|{c++}|{java}|\n'.format(**data)
239239
f.write(line)

0 commit comments

Comments
 (0)