修改讲义生成.py中的一处bug
This commit is contained in:
parent
8968041d21
commit
5a66126cda
|
|
@ -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)):
|
||||
|
|
|
|||
Reference in New Issue