{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "010923,010924,010925,010926,030013,010928,010929,010930,030014,010932,010933,010934,010935,010936,010937,010938,010939,010940,010941,010942,010943\n" ] } ], "source": [ "import re\n", "\n", "#输入文件名\n", "tex_file = r\"C:\\Users\\weiye\\Documents\\wwy sync\\23届\\上学期周末卷\\周末卷01.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 }