This commit is contained in:
512song committed 2023-09-15 23:47:23 +08:00
1 parent 41c9b72c55
commit 398d997b2e
1 file changed
+61 -10
+61 -10
View File
@@ -1705,15 +1705,15 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"id": "25283932-c03a-4a34-a59d-314fc64d8fbd",
"metadata": {
"execution": {
"iopub.execute_input": "2023-09-15T06:05:41.102421Z",
"iopub.status.busy": "2023-09-15T06:05:41.102217Z",
"iopub.status.idle": "2023-09-15T06:05:41.790471Z",
"shell.execute_reply": "2023-09-15T06:05:41.789908Z",
"shell.execute_reply.started": "2023-09-15T06:05:41.102407Z"
"iopub.execute_input": "2023-09-15T15:46:52.763943Z",
"iopub.status.busy": "2023-09-15T15:46:52.763438Z",
"iopub.status.idle": "2023-09-15T15:46:53.519617Z",
"shell.execute_reply": "2023-09-15T15:46:53.519093Z",
"shell.execute_reply.started": "2023-09-15T15:46:52.763906Z"
},
"tags": []
},
@@ -1752,15 +1752,66 @@
"print('ok')"
]
},
{
"cell_type": "markdown",
"id": "b758be8c-c9e2-46d4-b646-88403bb41e29",
"metadata": {},
"source": [
"## 生产读卡系统文件"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "c908e5e7-c014-4b8d-a583-a8c2f7115a96",
"metadata": {
"execution": {
"iopub.execute_input": "2023-09-15T15:46:56.254396Z",
"iopub.status.busy": "2023-09-15T15:46:56.254184Z",
"iopub.status.idle": "2023-09-15T15:46:56.297483Z",
"shell.execute_reply": "2023-09-15T15:46:56.296945Z",
"shell.execute_reply.started": "2023-09-15T15:46:56.254373Z"
},
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"ok\n"
]
}
],
"source": [
"import json\n",
"\n",
"filename = 'data/天津石化人员名单2023.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl)\n",
"list1 = []\n",
"for k, v in dict1.items():\n",
" dict2 = {}\n",
" #if dict1['sex'] =='男':\n",
" # sex = 1\n",
" \n",
" dict2 = {'id':k,'name':v['name'],'gender':v['sex'],'birth':v['birth'],'unit':v['unit']}\n",
" list1.append(dict2)\n",
"json_data = json.dumps(list1,ensure_ascii=False, indent=4) \n",
"\n",
"# 将 json 数据写入文件\n",
"with open(\"data/data1.json\", \"w\",encoding = 'utf-8') as file:\n",
" file.write(json_data) \n",
"print('ok')"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d84c41f5-6e8e-48f6-822f-fb8bdfb278b1",
"id": "fc8fa610-9c61-4baa-a1cc-901aef9f421c",
"metadata": {},
"outputs": [],
"source": [
"## 体测人员导入"
]
"source": []
}
],
"metadata": {