From bbcc15fb030d79da763c7c4813370846e7e51de5 Mon Sep 17 00:00:00 2001 From: "weiye.wang" Date: Fri, 9 Feb 2024 08:14:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20=E6=96=B0=E9=A2=98?= =?UTF-8?q?=E6=AF=94=E5=AF=B9.py=20=E4=BD=BF=E7=94=A8=E6=95=B4=E4=B8=AA?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=A4=8D=E5=88=B6=E5=88=B0=E5=89=AA=E8=B4=B4?= =?UTF-8?q?=E6=9D=BF=E4=BD=9C=E4=B8=BAdata?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 工具v2/新题比对.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/工具v2/新题比对.py b/工具v2/新题比对.py index b415a61d..8f0229e7 100644 --- a/工具v2/新题比对.py +++ b/工具v2/新题比对.py @@ -8,7 +8,9 @@ templatepath = ".\模板文件\讲义模板.txt" pro_dict = load_dict("../题库0.3/problems.json") treated_dict = treat_dict(pro_dict) -data = getCopy() +data_raw = getCopy() +problems_raw = re.findall(r"\\begin\{enumerate\}([\s\S]*)\\end\{enumerate\}",data_raw) +data = "\n".join([item.strip() for item in problems_raw]) problems = [(d.strip()) for d in data.split("\\item") if not d.strip() == ""] output = "使用说明:\\\\\n rep??????表示使用已有题号??????,\\\\\n s??????表示和??????相同,\\\\\n r??????表示和??????相关\n\n\\begin{enumerate}\n\n" for p in problems: