{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "010944,030017,010946,010947,010948,010949,010950,010951,010952,010953,010954,010955,010956,002874,010958,010959,010960,010961,010962,010963,010964\n" ] } ], "source": [ "import re\n", "\n", "#输入文件名\n", "tex_file = r\"C:\\Users\\weiye\\Documents\\wwy sync\\23届\\上学期周末卷\\周末卷02.tex\"\n", "\n", "with open(tex_file,\"r\",encoding = \"utf8\") as f:\n", " tex_data = f.read()\n", "problems_list = re.findall(r\"\\(([\\d]{6})\\)\",tex_data)\n", "\n", "print(\",\".join(problems_list))" ] }, { "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 }