This commit is contained in:
512song committed 2022-11-07 12:46:31 +08:00
1 parent 94bfa87942
commit 590c1f95d7
1 file changed
+53 -1
+53 -1
View File
@@ -1332,6 +1332,58 @@
"wb.save(filename) \n"
]
},
{
"cell_type": "markdown",
"id": "8656633b-19fe-4723-95d1-07e7af25d1e7",
"metadata": {},
"source": [
"## 核对未参加体测人员"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "b4a130de-5b15-40d2-a515-5d26265d84a8",
"metadata": {
"execution": {
"iopub.execute_input": "2022-11-07T04:15:15.150017Z",
"iopub.status.busy": "2022-11-07T04:15:15.148851Z",
"iopub.status.idle": "2022-11-07T04:15:15.575052Z",
"shell.execute_reply": "2022-11-07T04:15:15.571815Z",
"shell.execute_reply.started": "2022-11-07T04:15:15.149902Z"
},
"tags": []
},
"outputs": [],
"source": [
"import json\n",
"import openpyxl\n",
"import glob,os\n",
"\n",
"filename = 'data/济南炼化人员名单.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl)\n",
"list1 = []\n",
"fls = glob.glob(f'file/211130/*.pdf')\n",
"for fn in fls:\n",
" name = os.path.basename(fn).split('.')[0].rjust(5,\"0\")\n",
" list1.append(name)\n",
"person = []\n",
"for k, v in dict1.items():\n",
" if k not in list1:\n",
" list2 = []\n",
" person.append([k,dict1[k]['name'],dict1[k]['sex'],dict1[k]['unit']])\n",
"filename = '中石化济南分公司未参加体测人员情况表.xlsx'\n",
"title =['测试编号','姓名','性别','部门']\n",
"wb = openpyxl.Workbook()\n",
"sheet = wb.active\n",
"sheet.append(title)\n",
"for row in person:\n",
" sheet.append(row)\n",
" \n",
"wb.save(filename)"
]
},
{
"cell_type": "markdown",
"id": "b633b350-3fe7-42d5-a832-b53ec1007a99",
@@ -3024,7 +3076,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},