{ "cells": [ { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "23_多面体及旋转体的概念与性质.tex\n", "030116\n", "\n", "\n", "030119\n", "\n", "\n", "030120\n", "\n", "\n", "010523\n", "\n", "\n", "001695\n", "\n", "\n", "030122\n", "\n", "\n", "030158\n", "\n", "\n", "000207\n", "\n", "\n", "010510\n", "\n", "\n", "001712\n", "\n", "\n", "030125\n", "\n", "\n", "009202\n", "\n", "\n", "000203\n", "\n", "\n", "000214\n", "\n", "\n", "003996\n", "\n", "\n", "030126\n", "\n", "\n", "003982\n", "\n", "\n", "030128\n", "\n", "\n", "000197\n", "\n", "\n", "030137\n", "\n", "\n", "030124\n", "\n", "\n", "030139\n", "\n", "\n", "030142\n", "\n", "\n", "030159\n", "\n", "\n", "009227\n", "\n", "\n", "007379\n", "\n", "\n", "009200\n", "\n", "\n", "009716\n", "\n", "\n", "010531\n", "\n", "\n", "010529\n", "\n", "\n" ] } ], "source": [ "import os,json,re\n", "\n", "#这里需要修改, 设定路径与选择文件\n", "fileind = 23\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.8 ('base')", "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.8" }, "orig_nbformat": 4, "vscode": { "interpreter": { "hash": "d311ffef239beb3b8f3764271728f3972d7b090c974f8e972fcdeedf230299ac" } } }, "nbformat": 4, "nbformat_minor": 2 }