提交 cf392820 编写于 作者: F feilong

优化Python第3章代码+fix1

上级 783fa0fb
{
"source": "encode.py",
"source": "encode.md",
"depends": [],
"exercise_id": 107,
"type": "code_options",
......
{
"source": "triple01.py",
"source": "triple01.md",
"depends": [],
"exercise_id": 215,
"type": "code_options",
......
{
"source": "triple02.py",
"source": "triple02.md",
"depends": [],
"exercise_id": 203,
"type": "code_options",
......
{
"source": "assert.py",
"source": "assert.md",
"depends": [],
"exercise_id": 110,
"type": "code_options",
......
{
"source": "enter_exit.py",
"source": "enter_exit.md",
"depends": [],
"exercise_id": 178,
"type": "code_options",
......
{
"source": "withas.py",
"source": "withas.md",
"depends": [],
"exercise_id": 118,
"type": "code_options",
......
{
"source": "try01.py",
"source": "try01.md",
"depends": [],
"exercise_id": 237,
"type": "code_options",
......
{
"source": "str.py",
"source": "str.md",
"depends": [],
"exercise_id": 112,
"type": "code_options",
......
{
"source": "lambda.py",
"source": "lambda.md",
"depends": [],
"exercise_id": 108,
"type": "code_options",
......
{
"source": "file_basic.py",
"source": "file_basic.md",
"depends": [],
"exercise_id": 199,
"type": "code_options",
......
{
"source": "file_piece_sha256.py",
"source": "file_piece_sha256.md",
"depends": [],
"exercise_id": 213,
"type": "code_options",
......
{
"source": "std01.py",
"source": "std01.md",
"depends": [],
"exercise_id": 222,
"type": "code_options",
......
{
"source": "std02.py",
"source": "std02.md",
"depends": [],
"exercise_id": 196,
"type": "code_options",
......
......@@ -6,8 +6,8 @@ import os
import re
if __name__ == '__main__':
walker = TreeWalker("data", "python", "python")
walker.walk()
# walker = TreeWalker("data", "python", "python")
# walker.walk()
# md = MDWalker('data/1.python初阶/3.进阶语法')
# md.walk()
md = MDWalker('data/1.python初阶/3.进阶语法')
md.walk()
......@@ -91,7 +91,11 @@ class MDWalker():
print(json_file)
if os.path.exists(md_file):
j = load_json(json_file)
j['source'] = j['source'].replace('.py', '.md')
dump_json(json_file, j, True, True)
continue
md = []
self.emit_head(md, py)
self.emit_template(md, py)
......@@ -107,6 +111,7 @@ class MDWalker():
del j['multiline']
j['author'] = py['author']
j['notebook_enable'] = True
j['source'] = j['source'].replace('.py', '.md')
dump_json(json_file, j, True, True)
def emit_head(self, md, py):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册