This repository has been archived on 2024-06-23. You can view files and clone it, but cannot push or open issues or pull requests.
mathdeptv2/工具/寻找tex文件中未赋答案的题目.ipynb

142 lines
2.8 KiB
Plaintext

{
"cells": [
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"32_空间向量的概念与性质及立体几何中的证明问题.tex\n",
"009860\n",
"\n",
"\n",
"001966\n",
"\n",
"\n",
"001969\n",
"\n",
"\n",
"010715\n",
"\n",
"\n",
"001956\n",
"\n",
"\n",
"030464\n",
"\n",
"\n",
"030457\n",
"\n",
"\n",
"010733\n",
"\n",
"\n",
"001949\n",
"\n",
"\n",
"001957\n",
"\n",
"\n",
"010714\n",
"\n",
"\n",
"001958\n",
"\n",
"\n",
"001965\n",
"\n",
"\n",
"003679\n",
"\n",
"\n",
"030470\n",
"\n",
"\n",
"030454\n",
"\n",
"\n",
"009858\n",
"\n",
"\n",
"001980\n",
"\n",
"\n",
"001968\n",
"\n",
"\n",
"001976\n",
"\n",
"\n",
"001954\n",
"\n",
"\n",
"030479\n",
"\n",
"\n"
]
}
],
"source": [
"import os,json,re\n",
"\n",
"#这里需要修改, 设定路径与选择文件\n",
"fileind = 32\n",
"# path = r\"C:\\Users\\weiye\\Documents\\wwy sync\\23届\\上学期测验卷\"\n",
"path = r\"C:\\Users\\weiye\\Documents\\wwy sync\\23届\\第一轮复习讲义\"\n",
"\n",
"fileind = fileind - 1\n",
"with open(\"../题库0.3/Problems.json\",\"r\",encoding = \"utf8\") as f:\n",
" jsondata = f.read()\n",
"pro_dict = json.loads(jsondata)\n",
"\n",
"filelist = [f for f in os.listdir(path) if \".tex\" in f]\n",
"file = filelist[fileind]\n",
"print(file)\n",
"with open(os.path.join(path,file),\"r\",encoding = \"utf8\") as f:\n",
" data = f.read()\n",
" idlist = re.findall(r\"\\(([\\d]{6})\\)\",data)\n",
" for id in idlist:\n",
" if pro_dict[id][\"ans\"].strip() == \"\":\n",
" print(id+\"\\n\\n\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.8.15 ('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.8.15"
},
"orig_nbformat": 4,
"vscode": {
"interpreter": {
"hash": "42dd566da87765ddbe9b5c5b483063747fec4aacc5469ad554706e4b742e67b2"
}
}
},
"nbformat": 4,
"nbformat_minor": 2
}