修改讲义生成.py中的一处bug

This commit is contained in:
weiye.wang 2024-01-17 21:01:17 +08:00
parent 73fa96f026
commit 8fed5a30e1
1 changed files with 8 additions and 4 deletions

View File

@ -1,8 +1,8 @@
notes_dict_path = "../备课组/26届/校本材料.json" # 讲义基础知识目标号码所在json数据库路径
lessonpattern = r"[G]2026021[45]" # 正则表达式, 数据库中讲义的编号([A-Z][0-9]{4}[(01)|(02)][[0-9]{2}), 字母表示类型, 四位数字表示届别, 2位数字表示学期及其他, 2位数字表示序号
lessonpattern = r"[G]20260\d{3}" # 正则表达式, 数据库中讲义的编号([A-Z][0-9]{4}[(01)|(02)][[0-9]{2}), 字母表示类型, 四位数字表示届别, 2位数字表示学期及其他, 2位数字表示序号
outputdir = "d:/temp/26届材料" # 输出文件夹, 不建议修改
answered = False # 设置是否编译答案
consecutivenumbering = True # 设置是否用连续编号, 试卷请设为True, 普通讲义请设为False
answered = True # 设置是否编译答案
consecutivenumbering = False # 设置是否用连续编号, 试卷请设为True, 普通讲义请设为False
from database_tools import *
@ -31,4 +31,8 @@ for i in range(len(papernames)):
mergedtext = StringSubstitute(r"<<待替换[\d]+>>",ReadTextFile("./模板文件/合集模板.txt"),[merged])
SaveTextFile(mergedtext,os.path.join(outputdir,f"合集{GetDate()}.tex"))
SaveTextFile(mergedtext,os.path.join(outputdir,f"合集{GetDate()}.tex"))
tocompile = input("需要编译合集吗?(Y/[N]):")
if tocompile[0].upper() == "Y":
XeLaTeXCompile(outputdir,f"合集{GetDate()}.tex")