From 5a66126cda6cb18c6eafd9b430ca21069c7041e6 Mon Sep 17 00:00:00 2001 From: wangweiye7840 Date: Wed, 24 Jan 2024 10:05:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=B2=E4=B9=89=E7=94=9F?= =?UTF-8?q?=E6=88=90.py=E4=B8=AD=E7=9A=84=E4=B8=80=E5=A4=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 工具v2/讲义生成.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/工具v2/讲义生成.py b/工具v2/讲义生成.py index bccaab28..aaa4ae69 100644 --- a/工具v2/讲义生成.py +++ b/工具v2/讲义生成.py @@ -1,5 +1,5 @@ notes_dict_path = "../备课组/26届/校本材料.json" # 讲义(题,基础知识,目标)号码所在json数据库路径 -lessonpattern = r"[G]20260\d{3}" # 正则表达式, 数据库中讲义的编号([A-Z][0-9]{4}[(01)|(02)][[0-9]{2}), 字母表示类型, 四位数字表示届别, 2位数字表示学期及其他, 2位数字表示序号 +lessonpattern = r"G202602((4[0-8])|(53))" # 正则表达式, 数据库中讲义的编号([A-Z][0-9]{4}[(01)|(02)][[0-9]{2}), 字母表示类型, 四位数字表示届别, 2位数字表示学期及其他, 2位数字表示序号 outputdir = "d:/temp/26届材料" # 输出文件夹, 不建议修改 answered = True # 设置是否编译答案 consecutivenumbering = False # 设置是否用连续编号, 试卷请设为True, 普通讲义请设为False @@ -22,7 +22,7 @@ for lessonid in notes_dict["notes"]: filename = notes_dict["notes"][lessonid]["id"]+notes_dict["notes"][lessonid]["filename"]+".tex" texdata = GenerateSingleLessonNote(id = lessonid,notesdict = notes_dict, metadict = dictionaries, templatepath = ".\模板文件\讲义模板.txt", outputfilepath = os.path.join(outputdir,filename),consecutivenumbering=consecutivenumbering,answered=answered) papernames.append(notes_dict["notes"][lessonid]["id"]+" \\ "+notes_dict["notes"][lessonid]["name"]) - multitexdata.append(re.findall(r"\\begin\{enumerate\}[\s\S]*\\end\{enumerate\}",texdata)[0]) + multitexdata.append(re.findall(r"\\begin{center}\n{\\bf\\large \\papername}\n\\end{center}([\s\S]*\\end\{enumerate\})",texdata)[0]) merged = "" for i in range(len(papernames)):