{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\上学期测验卷\\example.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\上学期测验卷\\基础考.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\上学期测验卷\\月考01.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\上学期测验卷\\测验01.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\上学期测验卷\\测验02.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\上学期测验卷\\测验03.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\上学期测验卷\\测验04.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\上学期测验卷\\测验05.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\上学期测验卷\\测验06.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\上学期测验卷\\测验07.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\上学期测验卷\\测验08.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\上学期测验卷\\测验09.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\上学期测验卷\\测验10.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\上学期测验卷\\测验11.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\上学期测验卷\\测验12.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\上学期测验卷\\测验13.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\上学期测验卷\\线上测验01.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\上学期周末卷\\周末卷01.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\上学期周末卷\\周末卷02.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\上学期周末卷\\周末卷03.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\上学期周末卷\\周末卷03_暂未使用.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\上学期周末卷\\周末卷04.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\上学期周末卷\\周末卷05.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\上学期周末卷\\周末卷06.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\上学期周末卷\\周末卷07.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\上学期周末卷\\周末卷08.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\上学期周末卷\\周末卷09.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\上学期周末卷\\周末卷10.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\上学期周末卷\\周末卷11.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\上学期周末卷\\周末卷12.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\上学期周末卷\\周末卷13.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\上学期周末卷\\周末卷14.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\上学期周末卷\\国庆卷.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\\01_集合.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\\02_常用逻辑用语.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\\03_等式与不等式的性质及证明.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\\04_方程与不等式的求解.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\\05_幂指数与对数.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\\06_幂指对函数.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\\07_函数的概念与奇偶性.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\\08_函数的单调性.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\\09_函数的零点与最值.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\\10_有关函数的应用问题.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\\11_三角比的定义及直接性质.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\\12_和差倍角公式.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\\13_解三角形.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\\14_正弦函数及正弦型函数.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\\15_周期性与其他三角函数.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\\16_平面向量的概念及线性运算.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\\17_平面向量的投影及数量积.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\\18_复数的代数运算与性质.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\\19_复数的几何意义与实系数二次方程.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\\20_描述空间位置关系的公理.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\\21_空间直线与平面的位置关系.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\\22_空间平面与平面的位置关系.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\\23_多面体及旋转体的概念与性质.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\\24_体积及表面积的计算.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\\25_概率的概念及性质.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\\26_大数定律及独立性.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\\27_统计初步中的术语.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\\28_导数的概念及常用公式.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\\29_导数的应用.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\\30_等差数列与等比数列.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\\31_数列的递推与通项及数学归纳法.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\\32_空间向量的概念与性质及立体几何中的证明问题.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\\33_立体几何中的定量计算.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\\34_直线及其方程.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\\35_圆及曲线方程.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\\36_椭圆与双曲线的概念及性质.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\\37_抛物线的概念及性质.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\\38_计数原理与排列组合.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\\39_二项式定理.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\\example.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\赋能\\赋能01.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\赋能\\赋能02.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\赋能\\赋能03.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\赋能\\赋能04.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\赋能\\赋能05.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\赋能\\赋能06.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\赋能\\赋能07.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\赋能\\赋能08.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\赋能\\赋能09.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\赋能\\赋能10.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\赋能\\赋能11.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\赋能\\赋能12.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\赋能\\赋能13.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\赋能\\赋能14.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\赋能\\赋能15.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\赋能\\赋能16.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\赋能\\赋能17.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\赋能\\赋能18.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\赋能\\赋能19.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\赋能\\赋能20.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\赋能\\赋能21.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\赋能\\赋能22.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\赋能\\赋能23.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\赋能\\赋能24.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\赋能\\赋能25.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\赋能\\赋能26.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\赋能\\赋能27.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\赋能\\赋能28.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\赋能\\赋能29.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\赋能\\赋能30.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\一模后春考前试卷备选\\2017届上海春季高考.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\一模后春考前试卷备选\\2018届上海春季高考.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\一模后春考前试卷备选\\2019届上海春季高考.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\一模后春考前试卷备选\\2020届上海春季高考.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\一模后春考前试卷备选\\2021届上海春季高考.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\一模后春考前试卷备选\\2022届上海春季高考.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\一模后春考前试卷备选\\2023届上海春季高考.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\一模后春考前试卷备选\\2023届嘉定区一模.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\一模后春考前试卷备选\\2023届奉贤区一模.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\一模后春考前试卷备选\\2023届宝山区一模.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\一模后春考前试卷备选\\2023届崇明区一模.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\一模后春考前试卷备选\\2023届徐汇区一模.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\一模后春考前试卷备选\\2023届普陀区一模.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\一模后春考前试卷备选\\2023届杨浦区一模.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\一模后春考前试卷备选\\2023届松江区一模.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\一模后春考前试卷备选\\2023届浦东新区一模.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\一模后春考前试卷备选\\2023届虹口区一模.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\一模后春考前试卷备选\\2023届金山区一模.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\一模后春考前试卷备选\\2023届长宁区一模.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\一模后春考前试卷备选\\2023届闵行区一模.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\一模后春考前试卷备选\\2023届青浦区一模.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\一模后春考前试卷备选\\2023届静安区一模.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\正态分布及成对数据新课\\一月新课作业.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\正态分布及成对数据新课\\正态分布及成对数据测试.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\寒假作业\\中档题.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\寒假作业\\容易题.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\寒假作业\\寒假作业反馈练习.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\寒假作业\\较难题.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\下学期测验卷\\高三下学期月考01.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\下学期测验卷\\高三下学期测验01.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\下学期测验卷\\高三下学期测验02.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\下学期测验卷\\高三下学期测验03.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\下学期测验卷\\高三下学期测验04.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\下学期测验卷\\高三下学期测验05.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\下学期周末卷\\高三下学期周末卷01.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\下学期周末卷\\高三下学期周末卷02.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\下学期周末卷\\高三下学期周末卷03.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\下学期周末卷\\高三下学期周末卷04.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第二轮复习讲义\\01_集合与逻辑.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第二轮复习讲义\\02_等式与不等式.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第二轮复习讲义\\03_幂指对函数.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第二轮复习讲义\\04_函数的概念与性质.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第二轮复习讲义\\05_函数综合.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第二轮复习讲义\\06_三角与解三角形.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第二轮复习讲义\\07_三角函数.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第二轮复习讲义\\08_平面向量与复数.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第二轮复习讲义\\09_立体几何综合.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第二轮复习讲义\\10_空间向量与应用.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第二轮复习讲义\\11_直线与圆.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第二轮复习讲义\\12_圆锥曲线.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第二轮复习讲义\\13_解析几何综合.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第二轮复习讲义\\14_等差数列和等比数列.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第二轮复习讲义\\15_数列综合.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第二轮复习讲义\\16_导数及其应用.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第二轮复习讲义\\17_计数原理与二项式定理.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第二轮复习讲义\\18_概率与统计.tex\n", "C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第二轮复习讲义\\19_统计.tex\n", "d:\\mathdeptv2\\工具\\临时文件\\2022学年下学期高一高二材料_学生用_20230324.tex\n", "d:\\mathdeptv2\\工具\\临时文件\\2022学年下学期高一高二材料_学生用_20230326.tex\n", "d:\\mathdeptv2\\工具\\临时文件\\2022学年下学期高一高二材料_学生用_20230330.tex\n", "d:\\mathdeptv2\\工具\\临时文件\\2022学年下学期高一高二材料_教师用_20230324.tex\n", "d:\\mathdeptv2\\工具\\临时文件\\2022学年下学期高一高二材料_教师用_20230326.tex\n", "d:\\mathdeptv2\\工具\\临时文件\\2022学年下学期高一高二材料_教师用_20230330.tex\n", "d:\\mathdeptv2\\工具\\临时文件\\2025届1112班较难题_学生用_20230327.tex\n", "d:\\mathdeptv2\\工具\\临时文件\\2025届1112班较难题_学生用_20230328.tex\n", "d:\\mathdeptv2\\工具\\临时文件\\2025届1112班较难题_教师用_20230327.tex\n", "d:\\mathdeptv2\\工具\\临时文件\\2025届1112班较难题_教师用_20230328.tex\n", "d:\\mathdeptv2\\工具\\临时文件\\23届第一轮复习讲义参考答案.tex\n", "d:\\mathdeptv2\\工具\\临时文件\\23届高三上学期周末卷参考答案.tex\n", "d:\\mathdeptv2\\工具\\临时文件\\23届高三上学期测验卷参考答案.tex\n", "d:\\mathdeptv2\\工具\\临时文件\\test1.tex\n", "d:\\mathdeptv2\\工具\\临时文件\\易错题_学生用_20230328.tex\n", "d:\\mathdeptv2\\工具\\临时文件\\易错题_教师用_20230328.tex\n", "d:\\mathdeptv2\\工具\\临时文件\\本学期高一高二年级新试卷_学生用_20230319.tex\n", "d:\\mathdeptv2\\工具\\临时文件\\本学期高一高二年级新试卷_教师用_20230319.tex\n", "d:\\mathdeptv2\\工具\\临时文件\\测试_学生用_20230329.tex\n", "d:\\mathdeptv2\\工具\\临时文件\\测试_教师用_20230329.tex\n", "d:\\mathdeptv2\\工具\\临时文件\\立体几何综合答案.tex\n", "d:\\mathdeptv2\\工具\\临时文件\\第二轮复习讲义参考答案.tex\n", "d:\\mathdeptv2\\工具\\临时文件\\赋能1至30参考答案.tex\n", "d:\\mathdeptv2\\工具\\临时文件\\赋能1至40参考答案.tex\n", "d:\\mathdeptv2\\工具\\临时文件\\轨迹_学生用_20230325.tex\n", "d:\\mathdeptv2\\工具\\临时文件\\轨迹_教师用_20230325.tex\n", "d:\\mathdeptv2\\工具\\临时文件\\题库_学生用_20230401.tex\n", "d:\\mathdeptv2\\工具\\临时文件\\题库_教师用_20230401.tex\n", "d:\\mathdeptv2\\工具\\临时文件\\高三易错题_学生用_20230331.tex\n", "d:\\mathdeptv2\\工具\\临时文件\\高三易错题_教师用_20230331.tex\n" ] } ], "source": [ "import os,re\n", "\"---此处输入文件夹列表---\"\n", "directories = [r\"C:\\Users\\weiye\\Documents\\wwy sync\\23届\\上学期测验卷\",\n", "r\"C:\\Users\\weiye\\Documents\\wwy sync\\23届\\上学期周末卷\",\n", "r\"C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\",\n", "r\"C:\\Users\\weiye\\Documents\\wwy sync\\23届\\赋能\",\n", "r\"C:\\Users\\weiye\\Documents\\wwy sync\\23届\\一模后春考前试卷备选\",\n", "r\"C:\\Users\\weiye\\Documents\\wwy sync\\23届\\正态分布及成对数据新课\",\n", "r\"C:\\Users\\weiye\\Documents\\wwy sync\\23届\\寒假作业\",\n", "r\"C:\\Users\\weiye\\Documents\\wwy sync\\23届\\下学期测验卷\",\n", "r\"C:\\Users\\weiye\\Documents\\wwy sync\\23届\\下学期周末卷\",\n", "r\"C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第二轮复习讲义\",\n", "r\"d:\\mathdeptv2\\工具\\临时文件\"\n", "]\n", "\"---文件夹列表输入结束---\"\n", "\n", "for directory in directories:\n", " filelist = [filename for filename in os.listdir(directory) if \".tex\" in filename]\n", "\n", " output = \"\"\n", " outputv2 = \"\"\n", "\n", " for filename in filelist:\n", " print(os.path.join(directory,filename))\n", " output += filename + \"\\n\"\n", " outputv2 += filename + \"\\n\"\n", " with open(os.path.join(directory,filename),\"r\",encoding = \"u8\") as f:\n", " try:\n", " data = re.findall(r\"\\\\begin{document}([\\s\\S]*?)\\\\end{document}\",f.read())[0]\n", " data = data.replace(r\"\\section\",\"endsecbeginsec\") + \"endsec\"\n", " if not \"beginsec\" in data: \n", " data = \"beginsec\" + data\n", " sectionlist = re.findall(r\"beginsec([\\s\\S]*?)endsec\",data)\n", " for sec in sectionlist:\n", " secname = re.findall(r\"{([\\S]*)}\",sec)[0]\n", " output += secname + \"\\n\"\n", " # print(secname)\n", " v2idlist = []\n", " for id in re.findall(r\"\\(\\d{6}\\)\",sec):\n", " # print(id)\n", " v2idlist.append(id[1:-1])\n", " output += id + \"\\n\"\n", " outputv2 += '\"'+\",\".join(v2idlist)+'\",'\n", " except:\n", " pass \n", " output += \"\\n\\n\"\n", " outputv2 = outputv2[:-1] + \"\\n\\n\"\n", " # print(\"\\n\\n\")\n", "\n", " with open(os.path.join(directory,\"题号清点.txt\"),\"w\",encoding = \"u8\") as f:\n", " f.write(output + \"\\n\\n\\n以下题号不含括号\\n\\n\\n\" + output.replace(\"(\",\"\").replace(\")\",\"\")+outputv2)\n", "\n", " \n", "\n", "\n", " \n", " \n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "mathdept", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.15" }, "orig_nbformat": 4, "vscode": { "interpreter": { "hash": "ff3c292c316ba85de6f1ad75f19c731e79d694e741b6f515ec18f14996fe48dc" } } }, "nbformat": 4, "nbformat_minor": 2 }