{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "004080,004122,004312,004451,004557,004276,030019,004356,004320,004359,030020,004091,004400,008101,004157,004440,004370,004224,004328,004444,004247\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
}
