This commit is contained in:
512song committed 2023-09-05 16:28:09 +08:00
1 parent 24a9839483
commit 23ce121293
11 files changed
+1506 -561

No files matched your search

@@ -865,7 +865,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.10.6" "version": "3.10.12"
} }
}, },
"nbformat": 4, "nbformat": 4,
+1 -1
View File
@@ -1404,7 +1404,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.10.6" "version": "3.10.12"
} }
}, },
"nbformat": 4, "nbformat": 4,
+8 -8
View File
@@ -895,15 +895,15 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 2, "execution_count": 1,
"id": "cf345bf0-f11b-459e-9b69-b2843836f6f3", "id": "cf345bf0-f11b-459e-9b69-b2843836f6f3",
"metadata": { "metadata": {
"execution": { "execution": {
"iopub.execute_input": "2023-05-19T08:30:41.861658Z", "iopub.execute_input": "2023-08-29T13:51:03.280856Z",
"iopub.status.busy": "2023-05-19T08:30:41.860765Z", "iopub.status.busy": "2023-08-29T13:51:03.280394Z",
"iopub.status.idle": "2023-05-19T08:30:42.006745Z", "iopub.status.idle": "2023-08-29T13:51:03.399330Z",
"shell.execute_reply": "2023-05-19T08:30:42.006220Z", "shell.execute_reply": "2023-08-29T13:51:03.398909Z",
"shell.execute_reply.started": "2023-05-19T08:30:41.861616Z" "shell.execute_reply.started": "2023-08-29T13:51:03.280807Z"
}, },
"tags": [] "tags": []
}, },
@@ -915,7 +915,7 @@
"mydb = myclient[\"baogao\"]\n", "mydb = myclient[\"baogao\"]\n",
"mycol = mydb[\"place\"]\n", "mycol = mydb[\"place\"]\n",
"\n", "\n",
"mydict = { \"id\": \"714309\",\"name\": \"中国石化石家庄炼化公司\", }\n", "mydict = { \"id\": \"469849\",\"name\": \"长炼医院\", }\n",
" \n", " \n",
"x = mycol.insert_one(mydict) " "x = mycol.insert_one(mydict) "
] ]
@@ -1016,7 +1016,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.10.6" "version": "3.10.12"
} }
}, },
"nbformat": 4, "nbformat": 4,
+326 -141
View File
@@ -1,5 +1,13 @@
{ {
"cells": [ "cells": [
{
"cell_type": "markdown",
"id": "4626da6c-d228-4270-8d8d-c98784a106ad",
"metadata": {},
"source": [
"# 第一次体测"
]
},
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "ba2deee7-9c63-4115-bcee-ad341175fc02", "id": "ba2deee7-9c63-4115-bcee-ad341175fc02",
@@ -10,27 +18,12 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 52, "execution_count": null,
"id": "dea5e486-6927-469f-aa57-e5efac4670be", "id": "dea5e486-6927-469f-aa57-e5efac4670be",
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2023-05-31T05:19:09.972334Z",
"iopub.status.busy": "2023-05-31T05:19:09.971473Z",
"iopub.status.idle": "2023-05-31T05:19:10.054344Z",
"shell.execute_reply": "2023-05-31T05:19:10.053621Z",
"shell.execute_reply.started": "2023-05-31T05:19:09.972292Z"
},
"tags": [] "tags": []
}, },
"outputs": [ "outputs": [],
{
"name": "stdout",
"output_type": "stream",
"text": [
"ok\n"
]
}
],
"source": [ "source": [
"import openpyxl\n", "import openpyxl\n",
"import json\n", "import json\n",
@@ -255,27 +248,12 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 53, "execution_count": null,
"id": "c925d850-ff06-4be5-bf9f-31f4385c37c0", "id": "c925d850-ff06-4be5-bf9f-31f4385c37c0",
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2023-05-31T05:19:14.796522Z",
"iopub.status.busy": "2023-05-31T05:19:14.795763Z",
"iopub.status.idle": "2023-05-31T05:19:14.859923Z",
"shell.execute_reply": "2023-05-31T05:19:14.858869Z",
"shell.execute_reply.started": "2023-05-31T05:19:14.796492Z"
},
"tags": [] "tags": []
}, },
"outputs": [ "outputs": [],
{
"name": "stdout",
"output_type": "stream",
"text": [
"163\n"
]
}
],
"source": [ "source": [
"import json\n", "import json\n",
"import openpyxl\n", "import openpyxl\n",
@@ -313,28 +291,12 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 54, "execution_count": null,
"id": "a87384c6-dc46-4d09-b757-b42462ed818d", "id": "a87384c6-dc46-4d09-b757-b42462ed818d",
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2023-05-31T05:19:18.950211Z",
"iopub.status.busy": "2023-05-31T05:19:18.949352Z",
"iopub.status.idle": "2023-05-31T05:19:18.965945Z",
"shell.execute_reply": "2023-05-31T05:19:18.964916Z",
"shell.execute_reply.started": "2023-05-31T05:19:18.950168Z"
},
"tags": [] "tags": []
}, },
"outputs": [ "outputs": [],
{
"name": "stdout",
"output_type": "stream",
"text": [
"164\n",
"['659821', '079384', '876923', '387406', '694158', '563974', '628540', '281407', '798056', '274185', '705316', '571698', '693240', '650329', '481397', '610492', '250746', '619873', '675018', '619204', '984351', '279548', '027154', '856432', '296138', '290486', '218396', '973605', '269043', '653487', '528397', '031947', '370415', '872591', '018592', '251794', '718203', '869254', '408517', '071948', '536729', '259430', '867310', '285413', '805216', '405192', '630721', '386219', '504216', '418752', '402398', '231947', '850743', '901378', '394175', '431092', '157489', '961378', '305921', '620417', '352906', '629380', '417086', '086149', '804693', '342580', '310827', '637102', '128635', '346780', '325076', '643917', '710548', '046732', '762390', '350712', '368419', '342701', '245107', '087136', '023185', '759846', '346758', '514976', '570482', '781935', '210987', '340615', '075891', '810596', '430689', '920785', '815347', '917562', '295817', '765238', '058479', '674159', '567894', '109842', '851943', '703918', '073489', '403958', '578492', '798046', '502876', '943180', '498306', '835760', '726305', '490867', '709413', '275683', '256934', '721830', '973841', '729685', '021349', '265413', '321597', '064187', '136794', '708352', '710928', '657129', '962105', '905436', '513749', '257361', '420691', '941567', '839574', '906358', '218095', '364152', '562149', '109823', '560942', '293561', '194053', '509246', '026951', '243561', '093154', '654083', '519048', '459136', '914362', '605834', '508693', '823906', '349725', '572390', '541236', '419570', '513467', '724063', '164823', '890712', '529840', '641958', '678590', '648951']\n"
]
}
],
"source": [ "source": [
"import random\n", "import random\n",
"import json\n", "import json\n",
@@ -375,27 +337,12 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 55, "execution_count": null,
"id": "10845b90-48b4-4418-9dac-dd4a6f0147c0", "id": "10845b90-48b4-4418-9dac-dd4a6f0147c0",
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2023-05-31T05:19:22.535432Z",
"iopub.status.busy": "2023-05-31T05:19:22.534590Z",
"iopub.status.idle": "2023-05-31T05:19:22.546728Z",
"shell.execute_reply": "2023-05-31T05:19:22.545447Z",
"shell.execute_reply.started": "2023-05-31T05:19:22.535392Z"
},
"tags": [] "tags": []
}, },
"outputs": [ "outputs": [],
{
"name": "stdout",
"output_type": "stream",
"text": [
"163\n"
]
}
],
"source": [ "source": [
"filename = 'data/农业银行测试手机号码.json'\n", "filename = 'data/农业银行测试手机号码.json'\n",
"with open(filename,'r') as fl:\n", "with open(filename,'r') as fl:\n",
@@ -421,41 +368,14 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 37, "execution_count": null,
"id": "62733f52-62c1-43aa-964a-232eab8b5251", "id": "62733f52-62c1-43aa-964a-232eab8b5251",
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2023-05-25T10:18:47.776482Z",
"iopub.status.busy": "2023-05-25T10:18:47.776048Z",
"iopub.status.idle": "2023-05-25T10:18:48.066702Z",
"shell.execute_reply": "2023-05-25T10:18:48.065832Z",
"shell.execute_reply.started": "2023-05-25T10:18:47.776444Z"
},
"tags": [] "tags": []
}, },
"outputs": [ "outputs": [],
{
"name": "stdout",
"output_type": "stream",
"text": [
"{\n",
" \"SendStatusSet\": [\n",
" {\n",
" \"SerialNo\": \"2640:135690281916850099280618075\",\n",
" \"PhoneNumber\": \"+8613793180751\",\n",
" \"Fee\": 1,\n",
" \"SessionContext\": \"\",\n",
" \"Code\": \"Ok\",\n",
" \"Message\": \"send success\",\n",
" \"IsoCode\": \"CN\"\n",
" }\n",
" ],\n",
" \"RequestId\": \"7601194b-56e4-45a8-9543-6fcc76ce16a6\"\n",
"}\n"
]
}
],
"source": [ "source": [
"import json\n",
"from tencentcloud.common import credential\n", "from tencentcloud.common import credential\n",
"from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException\n", "from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException\n",
"from tencentcloud.sms.v20210111 import sms_client, models\n", "from tencentcloud.sms.v20210111 import sms_client, models\n",
@@ -477,8 +397,8 @@
" req = models.SendSmsRequest()\n", " req = models.SendSmsRequest()\n",
" req.SmsSdkAppId = \"1400140089\"\n", " req.SmsSdkAppId = \"1400140089\"\n",
" req.SignName = \"坤铭教育\"\n", " req.SignName = \"坤铭教育\"\n",
" req.TemplateId = \"1808914\" \n", " req.TemplateId = \"1875765\" \n",
" req.TemplateParamSet = [\"1234\"]\n", " req.TemplateParamSet = [\"北京石油分公司体测者\",\"01740518\"]\n",
" req.PhoneNumberSet = [\"+8613793180751\"]\n", " req.PhoneNumberSet = [\"+8613793180751\"]\n",
" req.SessionContext = \"\"\n", " req.SessionContext = \"\"\n",
" req.ExtendCode = \"\"\n", " req.ExtendCode = \"\"\n",
@@ -491,27 +411,12 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 41, "execution_count": null,
"id": "e924a0a9-65a5-49c4-bdf2-b9152d278ad5", "id": "e924a0a9-65a5-49c4-bdf2-b9152d278ad5",
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2023-05-25T11:05:39.390622Z",
"iopub.status.busy": "2023-05-25T11:05:39.389793Z",
"iopub.status.idle": "2023-05-25T11:05:39.396312Z",
"shell.execute_reply": "2023-05-25T11:05:39.395239Z",
"shell.execute_reply.started": "2023-05-25T11:05:39.390580Z"
},
"tags": [] "tags": []
}, },
"outputs": [ "outputs": [],
{
"name": "stdout",
"output_type": "stream",
"text": [
"send success\n"
]
}
],
"source": [ "source": [
"dict1 = json.loads(resp.to_json_string(indent=2))\n", "dict1 = json.loads(resp.to_json_string(indent=2))\n",
"print(dict1['SendStatusSet'][0][\"Message\"])" "print(dict1['SendStatusSet'][0][\"Message\"])"
@@ -527,30 +432,12 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 57, "execution_count": null,
"id": "910d1881-d090-48dc-ac87-685ccaaf9553", "id": "910d1881-d090-48dc-ac87-685ccaaf9553",
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2023-06-07T02:57:09.482569Z",
"iopub.status.busy": "2023-06-07T02:57:09.481698Z",
"iopub.status.idle": "2023-06-07T02:57:10.568979Z",
"shell.execute_reply": "2023-06-07T02:57:10.567913Z",
"shell.execute_reply.started": "2023-06-07T02:57:09.482528Z"
},
"tags": [] "tags": []
}, },
"outputs": [ "outputs": [],
{
"name": "stdout",
"output_type": "stream",
"text": [
"亓宇航 send success\n",
"李伟丽 send success\n",
"高松 send success\n",
"张树伟 send success\n"
]
}
],
"source": [ "source": [
"\n", "\n",
"from tencentcloud.common import credential\n", "from tencentcloud.common import credential\n",
@@ -588,7 +475,7 @@
" req.SessionContext = \"\"\n", " req.SessionContext = \"\"\n",
" req.ExtendCode = \"\"\n", " req.ExtendCode = \"\"\n",
" req.SenderId = \"\"\n", " req.SenderId = \"\"\n",
" resp = client.SendSms(req)\n", " #resp = client.SendSms(req)\n",
" dict2 = json.loads(resp.to_json_string(indent=2))\n", " dict2 = json.loads(resp.to_json_string(indent=2))\n",
"\n", "\n",
" print(v['name'],dict2['SendStatusSet'][0][\"Message\"])\n", " print(v['name'],dict2['SendStatusSet'][0][\"Message\"])\n",
@@ -596,10 +483,308 @@
" print(v['name'],err)" " print(v['name'],err)"
] ]
}, },
{
"cell_type": "markdown",
"id": "59d38404-e097-4f08-a3fd-565e351f09bb",
"metadata": {},
"source": [
"# 第二次体测"
]
},
{
"cell_type": "markdown",
"id": "deeb7606-5752-4337-9117-4ba9edc762e9",
"metadata": {},
"source": [
"## 人员信息导入"
]
},
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "759cad53-8745-4862-8874-cf35f13ab0b3", "id": "d803a2b2-4a61-42ba-84a3-e9846e3e9f5c",
"metadata": {},
"outputs": [],
"source": [
"import openpyxl\n",
"import json\n",
"\n",
"\n",
"wb = openpyxl.load_workbook('data/北京分行员工体质检测情况表.xlsx')\n",
"sheet = wb.active\n",
"# sheets = wb.sheetnames\n",
"person = {}\n",
"\n",
"for n in range(2, sheet.max_row+1):\n",
" if sheet.cell(n,1).value is not None:\n",
" code = int(sheet.cell(n, 1).value)\n",
" person.setdefault(code, {})\n",
" dict1 = {}\n",
" dict1['name'] = sheet.cell(n, 3).value\n",
" if sheet.cell(n, 4).value ==1:\n",
" sex = '男'\n",
" else:\n",
" sex = '女'\n",
" dict1['sex'] = sex\n",
" birth = str(sheet.cell(n, 5).value).split()[0]\n",
" dict1['birth'] = birth\n",
" dict1['unit'] = sheet.cell(n, 2).value\n",
" if sheet.cell(n,6).value is not None:\n",
" dict1['phone'] = sheet.cell(n, 6).value \n",
" person[code] = dict1\n",
"\n",
"filename = 'data/北京农行人员名单2308.json'\n",
"with open(filename, 'w') as fl:\n",
" json.dump(person, fl, ensure_ascii=False)\n",
"print('ok')"
]
},
{
"cell_type": "markdown",
"id": "ff97823f-fd67-45ae-bd78-f209317be6b9",
"metadata": {},
"source": [
"## 成绩导入"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4adf86dd-addf-490a-9954-5dcac4693868",
"metadata": {},
"outputs": [],
"source": [
"import json\n",
"import time\n",
"import csv\n",
"\n",
"filename = '../item.json'\n",
"item = {}\n",
"unit = {}\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"for k,v in dict1.items():\n",
" item[k] = v\n",
"re_ta = {}\n",
"dict1 = {}\n",
"list1 = []\n",
"filename = 'data/北京农行人员名单2308.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"\n",
"filename = 'data/places_result_20230825.csv'\n",
"with open(filename,'r',newline='') as csv_file:\n",
" fl = csv.reader(csv_file,delimiter=',')\n",
" header = next(fl) \n",
" for line in fl:\n",
" #line = re.sub('[\\r\\n\\f ]{1,}', '', line)\n",
" list1.append(line)\n",
"#print(list1)\n",
"for result in list1:\n",
" user = str(result[2])\n",
" if user in dict1.keys(): \n",
" m_item = str(result[3]) \n",
" re_ta.setdefault(user,{}) \n",
" re_ta[user]['name'] = dict1[user]['name']\n",
" re_ta[user]['sex'] = dict1[user]['sex'] \n",
" re_ta[user]['unit'] = dict1[user]['unit']\n",
" item_name = item[m_item]['name']\n",
" re_ta[user].setdefault(item_name,{}) \n",
" score = int(result[4])/item[m_item]['divisor'] \n",
" re_ta[user][item_name]['成绩'] = f'{score} {item[m_item][\"unit\"]}'\n",
"print(len(re_ta))\n",
"filename = 'data/result_北京农行0825.json'\n",
"\n",
"with open(filename,'w') as fl:\n",
" json.dump(re_ta, fl, ensure_ascii=False) \n",
"print(len(re_ta))"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "bb01b9a9-418d-4a1b-8ea9-1215af0b8285",
"metadata": {},
"outputs": [],
"source": [
"import json\n",
"import time\n",
"import csv\n",
"\n",
"filename = '../item.json'\n",
"item = {}\n",
"unit = {}\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"for k,v in dict1.items():\n",
" item[k] = v\n",
"re_ta = {}\n",
"dict1 = {}\n",
"list1 = []\n",
"filename = 'data/北京农行人员名单2308.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"\n",
"filename = 'data/places_result_20230825.csv'\n",
"with open(filename,'r',newline='') as csv_file:\n",
" fl = csv.reader(csv_file,delimiter=',')\n",
" header = next(fl) \n",
" for line in fl:\n",
" #line = re.sub('[\\r\\n\\f ]{1,}', '', line)\n",
" list1.append(line)\n",
"#print(list1)\n",
"for result in list1:\n",
" user = str(result[2])\n",
" if user in dict1.keys(): \n",
" m_item = str(result[3]) \n",
" re_ta.setdefault(user,{}) \n",
" re_ta[user]['name'] = dict1[user]['name']\n",
" re_ta[user]['sex'] = dict1[user]['sex'] \n",
" re_ta[user]['unit'] = dict1[user]['unit']\n",
" item_name = item[m_item]['name']\n",
" re_ta[user].setdefault(item_name,{}) \n",
" score = int(result[4])/item[m_item]['divisor'] \n",
" re_ta[user][item_name]['成绩'] = f'{score} {item[m_item][\"unit\"]}'\n",
"print(len(re_ta))\n",
"filename = 'data/result_北京农行0825.json'\n",
"\n",
"with open(filename,'w') as fl:\n",
" json.dump(re_ta, fl, ensure_ascii=False) \n",
"print(len(re_ta))"
]
},
{
"cell_type": "markdown",
"id": "4d2a0d63-4124-4063-96a7-a02478b9eabe",
"metadata": {},
"source": [
"## 查看项目不足人员"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "b26857af-5fa3-42d0-bf79-bc33d9f5e4a8",
"metadata": {},
"outputs": [],
"source": [
"import json\n",
"import time\n",
"import csv\n",
"\n",
"filename = 'data/result_北京农行0825.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"i= 0\n",
"for k, v in dict1.items():\n",
" if len(v.keys())< 8:\n",
" print(k,v['name'])"
]
},
{
"cell_type": "markdown",
"id": "1966307c-4161-4c5b-b19a-b8a143972223",
"metadata": {},
"source": [
"## 导出测试人员信息"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "288e39fb-b7e3-4566-ac13-ba98d7e72edb",
"metadata": {},
"outputs": [],
"source": [
"import json\n",
"import openpyxl\n",
"\n",
"\n",
"filename = 'data/result_北京农行0825.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl)\n",
"list1 =[]\n",
"for k, v in dict1.items():\n",
" list2 = []\n",
" list2 = [k,v['name'],v['sex'],v['unit']]\n",
" list1.append(list2)\n",
"filename = 'data/北京农行测试人员202308.xlsx'\n",
"wb = openpyxl.Workbook()\n",
"sheet = wb.active\n",
"\n",
"for row in list1:\n",
" sheet.append(row)\n",
" \n",
"wb.save(filename)"
]
},
{
"cell_type": "markdown",
"id": "a42cb587-8673-4655-8943-3cbd63f22b73",
"metadata": {},
"source": [
"## 检查性别"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "6352b95c-0e19-4943-9e99-218138213060",
"metadata": {},
"outputs": [],
"source": [
"import json\n",
"\n",
"\n",
"filename = 'data/result_北京农行0825.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl)\n",
"for k, v in dict1.items():\n",
" if v['sex'] == '男' and '一分钟仰卧起坐' in v.keys():\n",
" print(k,'应为女性!')\n",
" if v['sex'] == '女' and '俯卧撑' in v.keys():\n",
" print(k,'应为男性!')"
]
},
{
"cell_type": "markdown",
"id": "fddd68cd-b20c-4cf9-b503-5d59f52e3c1b",
"metadata": {},
"source": [
"## 手工数据生成SQL"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "372294de-5370-41c0-9883-b18de9d8ef7e",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"import openpyxl\n",
"import json\n",
"\n",
"\n",
"wb = openpyxl.load_workbook('data/北京农行测试人员202308.xlsx')\n",
"sheet = wb.active\n",
"# sheets = wb.sheetnames\n",
"dict1 = {}\n",
"\n",
"data1 =list(sheet.values)\n",
"del data1[0]\n",
"list1 = []\n",
"for item in data1:\n",
" code = int(item[0])\n",
" list1.append((309118,code,5,item[4],'2023-08-23','2023-08-23 22:00:00'))\n",
"print(list1)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "93d4d513-17ee-4f20-bd86-be52398b5852",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [] "source": []
@@ -621,7 +806,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.10.6" "version": "3.10.12"
} }
}, },
"nbformat": 4, "nbformat": 4,
+1 -1
View File
@@ -2204,7 +2204,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.10.6" "version": "3.10.12"
} }
}, },
"nbformat": 4, "nbformat": 4,
+1 -1
View File
@@ -1150,7 +1150,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.10.6" "version": "3.10.12"
} }
}, },
"nbformat": 4, "nbformat": 4,
+192 -275
View File
@@ -10,27 +10,12 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 94, "execution_count": null,
"id": "07f7e97e-670e-4301-b83d-1304514f15d5", "id": "07f7e97e-670e-4301-b83d-1304514f15d5",
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2023-07-05T02:45:10.229928Z",
"iopub.status.busy": "2023-07-05T02:45:10.229085Z",
"iopub.status.idle": "2023-07-05T02:45:10.320665Z",
"shell.execute_reply": "2023-07-05T02:45:10.319936Z",
"shell.execute_reply.started": "2023-07-05T02:45:10.229888Z"
},
"tags": [] "tags": []
}, },
"outputs": [ "outputs": [],
{
"name": "stdout",
"output_type": "stream",
"text": [
"ok\n"
]
}
],
"source": [ "source": [
"import openpyxl\n", "import openpyxl\n",
"import json\n", "import json\n",
@@ -65,6 +50,56 @@
"print('ok')" "print('ok')"
] ]
}, },
{
"cell_type": "markdown",
"id": "be805082-d5d7-405b-975c-fb902085a041",
"metadata": {},
"source": [
"## 文件更名"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "b51cf562-c708-4164-8431-5093247880c4",
"metadata": {},
"outputs": [],
"source": [
"import os,sys,shutil\n",
"import json\n",
"import math\n",
"import glob\n",
"from pathlib import Path\n",
"\n",
"fi_path = 'file/2023-06-07'\n",
"old = []\n",
"dict2 = {}\n",
"\n",
"filename = 'data/西藏人员.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl)\n",
"\n",
"for k, v in dict1.items():\n",
" m_name = v['name']\n",
" dict2[int(k)] = [m_name]\n",
"\n",
"fls = glob.glob(f'{fi_path}/*.pdf')\n",
"\n",
"for fn in fls:\n",
" old.append(os.path.basename(fn).split('.')[0])\n",
"\n",
"for n in old: \n",
" o_name = f'{fi_path}/{n}.pdf'\n",
" new_path = Path(fi_path,'new')\n",
" new_path.mkdir(parents = True, exist_ok = True)\n",
" n_name = Path(new_path,f'{str(n).rjust(5,\"0\")}-{dict2[int(n)][0]}.pdf')\n",
" if not os.path.exists(n_name):\n",
" shutil.copyfile(o_name,n_name)\n",
" print(n_name)\n",
" \n",
"print('ok')"
]
},
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "962f6edd-c8d1-42a2-aaff-58f92ccf8d56", "id": "962f6edd-c8d1-42a2-aaff-58f92ccf8d56",
@@ -309,28 +344,12 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 66, "execution_count": null,
"id": "e19a4c58-df1e-4136-bf10-33e9ed885e50", "id": "e19a4c58-df1e-4136-bf10-33e9ed885e50",
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2023-07-04T13:02:15.967924Z",
"iopub.status.busy": "2023-07-04T13:02:15.967138Z",
"iopub.status.idle": "2023-07-04T13:02:16.005279Z",
"shell.execute_reply": "2023-07-04T13:02:16.004236Z",
"shell.execute_reply.started": "2023-07-04T13:02:15.967883Z"
},
"tags": [] "tags": []
}, },
"outputs": [ "outputs": [],
{
"name": "stdout",
"output_type": "stream",
"text": [
"165\n",
"165\n"
]
}
],
"source": [ "source": [
"import json\n", "import json\n",
"import time\n", "import time\n",
@@ -447,31 +466,12 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 95, "execution_count": null,
"id": "3696d7e1-afb8-4f9d-ba29-9aaa977b52de", "id": "3696d7e1-afb8-4f9d-ba29-9aaa977b52de",
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2023-07-05T02:45:28.348666Z",
"iopub.status.busy": "2023-07-05T02:45:28.348242Z",
"iopub.status.idle": "2023-07-05T02:45:28.389486Z",
"shell.execute_reply": "2023-07-05T02:45:28.388452Z",
"shell.execute_reply.started": "2023-07-05T02:45:28.348638Z"
},
"tags": [] "tags": []
}, },
"outputs": [ "outputs": [],
{
"name": "stdout",
"output_type": "stream",
"text": [
"165\n",
"[]\n",
"165\n",
"ok\n",
"165\n"
]
}
],
"source": [ "source": [
"import json\n", "import json\n",
"import time\n", "import time\n",
@@ -491,7 +491,7 @@
"re_ta = {}\n", "re_ta = {}\n",
"list1 = []\n", "list1 = []\n",
"#print(\"\\n运动项目信息:\")\n", "#print(\"\\n运动项目信息:\")\n",
"filename = 'data/places_result_20230704.csv'\n", "filename = 'data/places_result_20230714.csv'\n",
"with open(filename,'r',newline='') as csv_file:\n", "with open(filename,'r',newline='') as csv_file:\n",
" fl = csv.reader(csv_file,delimiter=',')\n", " fl = csv.reader(csv_file,delimiter=',')\n",
" header = next(fl) \n", " header = next(fl) \n",
@@ -540,27 +540,12 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 96, "execution_count": null,
"id": "b71c8bf6-2530-425f-9516-8757b40e3dc5", "id": "b71c8bf6-2530-425f-9516-8757b40e3dc5",
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2023-07-05T02:45:31.683237Z",
"iopub.status.busy": "2023-07-05T02:45:31.682418Z",
"iopub.status.idle": "2023-07-05T02:45:31.710877Z",
"shell.execute_reply": "2023-07-05T02:45:31.709811Z",
"shell.execute_reply.started": "2023-07-05T02:45:31.683198Z"
},
"tags": [] "tags": []
}, },
"outputs": [ "outputs": [],
{
"name": "stdout",
"output_type": "stream",
"text": [
"ok\n"
]
}
],
"source": [ "source": [
"import json\n", "import json\n",
"import datetime\n", "import datetime\n",
@@ -592,27 +577,12 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 97, "execution_count": null,
"id": "0e75cfbb-2b63-4163-831c-933fff1481c2", "id": "0e75cfbb-2b63-4163-831c-933fff1481c2",
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2023-07-05T02:45:50.311946Z",
"iopub.status.busy": "2023-07-05T02:45:50.311092Z",
"iopub.status.idle": "2023-07-05T02:45:50.340231Z",
"shell.execute_reply": "2023-07-05T02:45:50.339150Z",
"shell.execute_reply.started": "2023-07-05T02:45:50.311906Z"
},
"tags": [] "tags": []
}, },
"outputs": [ "outputs": [],
{
"name": "stdout",
"output_type": "stream",
"text": [
"ok\n"
]
}
],
"source": [ "source": [
"import json\n", "import json\n",
"\n", "\n",
@@ -646,31 +616,12 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 98, "execution_count": null,
"id": "99f02e37-3a03-4d7d-a2b9-7bf5563c253c", "id": "99f02e37-3a03-4d7d-a2b9-7bf5563c253c",
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2023-07-05T02:45:52.771879Z",
"iopub.status.busy": "2023-07-05T02:45:52.771043Z",
"iopub.status.idle": "2023-07-05T02:45:52.802079Z",
"shell.execute_reply": "2023-07-05T02:45:52.801054Z",
"shell.execute_reply.started": "2023-07-05T02:45:52.771839Z"
},
"tags": [] "tags": []
}, },
"outputs": [ "outputs": [],
{
"name": "stdout",
"output_type": "stream",
"text": [
"0~255分人数:115人,男性:67人,女性:48人\n",
"256~332分人数:42人,男性:27人,女性:15人\n",
"333~367分人数:8人,男性:4人,女性:4人\n",
"368~500分人数:0人,男性:0人,女性:0人\n",
"ok\n"
]
}
],
"source": [ "source": [
"import json\n", "import json\n",
"\n", "\n",
@@ -714,34 +665,12 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 99, "execution_count": null,
"id": "1435c8af-094d-44b3-a024-af3615c07c21", "id": "1435c8af-094d-44b3-a024-af3615c07c21",
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2023-07-05T02:45:57.071802Z",
"iopub.status.busy": "2023-07-05T02:45:57.070977Z",
"iopub.status.idle": "2023-07-05T02:45:57.086551Z",
"shell.execute_reply": "2023-07-05T02:45:57.085522Z",
"shell.execute_reply.started": "2023-07-05T02:45:57.071762Z"
},
"tags": [] "tags": []
}, },
"outputs": [ "outputs": [],
{
"name": "stdout",
"output_type": "stream",
"text": [
"20~24岁平均成绩:2.43分,人数:9人,男性:7人\n",
"25~29岁平均成绩:2.14分,人数:49人,男性:27人\n",
"30~34岁平均成绩:2.26分,人数:38人,男性:22人\n",
"35~39岁平均成绩:2.39分,人数:27人,男性:12人\n",
"40~44岁平均成绩:2.37分,人数:26人,男性:15人\n",
"45~49岁平均成绩:2.52分,人数:10人,男性:9人\n",
"50~54岁平均成绩:2.48分,人数:5人,男性:5人\n",
"55~69岁平均成绩:2.67分,人数:1人,男性:1人\n"
]
}
],
"source": [ "source": [
"import json\n", "import json\n",
"\n", "\n",
@@ -776,34 +705,12 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 100, "execution_count": null,
"id": "650cf1eb-8681-4911-9b04-80468fe6bf64", "id": "650cf1eb-8681-4911-9b04-80468fe6bf64",
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2023-07-05T02:47:11.272824Z",
"iopub.status.busy": "2023-07-05T02:47:11.271965Z",
"iopub.status.idle": "2023-07-05T02:47:11.287782Z",
"shell.execute_reply": "2023-07-05T02:47:11.286539Z",
"shell.execute_reply.started": "2023-07-05T02:47:11.272783Z"
},
"tags": [] "tags": []
}, },
"outputs": [ "outputs": [],
{
"name": "stdout",
"output_type": "stream",
"text": [
"20~24岁平均成绩:2.45分,人数:7人\n",
"25~29岁平均成绩:2.0分,人数:27人\n",
"30~34岁平均成绩:2.39分,人数:22人\n",
"35~39岁平均成绩:2.36分,人数:12人\n",
"40~44岁平均成绩:2.53分,人数:15人\n",
"45~49岁平均成绩:2.54分,人数:9人\n",
"50~54岁平均成绩:2.48分,人数:5人\n",
"55~80岁平均成绩:2.67分,人数:1人\n"
]
}
],
"source": [ "source": [
"import json\n", "import json\n",
"\n", "\n",
@@ -838,34 +745,12 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 74, "execution_count": null,
"id": "9ccb9b3c-de57-49f4-a4c6-10a24737e857", "id": "9ccb9b3c-de57-49f4-a4c6-10a24737e857",
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2023-07-04T13:08:22.477549Z",
"iopub.status.busy": "2023-07-04T13:08:22.476783Z",
"iopub.status.idle": "2023-07-04T13:08:22.492628Z",
"shell.execute_reply": "2023-07-04T13:08:22.491401Z",
"shell.execute_reply.started": "2023-07-04T13:08:22.477510Z"
},
"tags": [] "tags": []
}, },
"outputs": [ "outputs": [],
{
"name": "stdout",
"output_type": "stream",
"text": [
"20~24岁平均成绩:2.33分,人数:2人\n",
"25~29岁平均成绩:2.32分,人数:22人\n",
"30~34岁平均成绩:2.07分,人数:16人\n",
"35~39岁平均成绩:2.41分,人数:15人\n",
"40~44岁平均成绩:2.15分,人数:11人\n",
"45~49岁平均成绩:2.33分,人数:1人\n",
"50~54岁平均成绩:0分,人数:0人\n",
"55~80岁平均成绩:0分,人数:0人\n"
]
}
],
"source": [ "source": [
"import json\n", "import json\n",
"\n", "\n",
@@ -899,29 +784,12 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 104, "execution_count": null,
"id": "c8cd897e-0d41-4faa-860f-395d42208674", "id": "c8cd897e-0d41-4faa-860f-395d42208674",
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2023-07-05T03:18:05.849161Z",
"iopub.status.busy": "2023-07-05T03:18:05.848313Z",
"iopub.status.idle": "2023-07-05T03:18:05.864430Z",
"shell.execute_reply": "2023-07-05T03:18:05.863382Z",
"shell.execute_reply.started": "2023-07-05T03:18:05.849120Z"
},
"tags": [] "tags": []
}, },
"outputs": [ "outputs": [],
{
"name": "stdout",
"output_type": "stream",
"text": [
"平均成绩:2.3266分,男性:98人\n",
"平均成绩:2.2533分,女性:67人\n",
"平均成绩:2.2968分,总体:165人\n"
]
}
],
"source": [ "source": [
"import json\n", "import json\n",
"\n", "\n",
@@ -960,34 +828,12 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 91, "execution_count": null,
"id": "28b418f2-2324-450f-9684-4df15e012694", "id": "28b418f2-2324-450f-9684-4df15e012694",
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2023-07-05T02:43:38.489757Z",
"iopub.status.busy": "2023-07-05T02:43:38.488929Z",
"iopub.status.idle": "2023-07-05T02:43:38.506679Z",
"shell.execute_reply": "2023-07-05T02:43:38.505448Z",
"shell.execute_reply.started": "2023-07-05T02:43:38.489716Z"
},
"tags": [] "tags": []
}, },
"outputs": [ "outputs": [],
{
"name": "stdout",
"output_type": "stream",
"text": [
"20-24 {'合格': 1, '不合格': 1}\n",
"25-29 {'良好': 2, '不合格': 15, '合格': 5}\n",
"30-34 {'合格': 3, '不合格': 12, '良好': 1}\n",
"35-39 {'合格': 4, '良好': 1, '不合格': 10}\n",
"40-44 {'不合格': 9, '良好': 0, '合格': 2}\n",
"45-49 {'不合格': 1, '合格': 0, '良好': 0}\n",
"50-54 {'合格': 0, '良好': 0, '不合格': 0}\n",
"55-80 {'合格': 0}\n"
]
}
],
"source": [ "source": [
"nld = [[20,24],[25,29],[30,34],[35,39],[40,44],[45,49],[50,54],[55,80]]\n", "nld = [[20,24],[25,29],[30,34],[35,39],[40,44],[45,49],[50,54],[55,80]]\n",
"\n", "\n",
@@ -1027,34 +873,12 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 102, "execution_count": null,
"id": "a80224fb-1726-4370-9d3d-6e0a27afa8b2", "id": "a80224fb-1726-4370-9d3d-6e0a27afa8b2",
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2023-07-05T02:47:19.469192Z",
"iopub.status.busy": "2023-07-05T02:47:19.468357Z",
"iopub.status.idle": "2023-07-05T02:47:19.486494Z",
"shell.execute_reply": "2023-07-05T02:47:19.485227Z",
"shell.execute_reply.started": "2023-07-05T02:47:19.469153Z"
},
"tags": [] "tags": []
}, },
"outputs": [ "outputs": [],
{
"name": "stdout",
"output_type": "stream",
"text": [
"20-24 {'合格': 3, '不合格': 4}\n",
"25-29 {'良好': 0, '不合格': 24, '合格': 3}\n",
"30-34 {'合格': 7, '不合格': 15, '良好': 0}\n",
"35-39 {'合格': 5, '良好': 0, '不合格': 7}\n",
"40-44 {'不合格': 9, '良好': 1, '合格': 5}\n",
"45-49 {'不合格': 5, '合格': 2, '良好': 2}\n",
"50-54 {'合格': 1, '良好': 1, '不合格': 3}\n",
"55-80 {'合格': 1}\n"
]
}
],
"source": [ "source": [
"nld = [[20,24],[25,29],[30,34],[35,39],[40,44],[45,49],[50,54],[55,80]]\n", "nld = [[20,24],[25,29],[30,34],[35,39],[40,44],[45,49],[50,54],[55,80]]\n",
"\n", "\n",
@@ -1094,32 +918,12 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 103, "execution_count": null,
"id": "945b9bec-247b-498b-96f6-a52fabbf6c89", "id": "945b9bec-247b-498b-96f6-a52fabbf6c89",
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2023-07-05T02:47:22.379999Z",
"iopub.status.busy": "2023-07-05T02:47:22.379167Z",
"iopub.status.idle": "2023-07-05T02:47:22.392962Z",
"shell.execute_reply": "2023-07-05T02:47:22.391756Z",
"shell.execute_reply.started": "2023-07-05T02:47:22.379959Z"
},
"tags": [] "tags": []
}, },
"outputs": [ "outputs": [],
{
"name": "stdout",
"output_type": "stream",
"text": [
"体重 3.46 164\n",
"肺活量 2.22 164\n",
"握力 1.19 164\n",
"坐位体前屈 1.9 163\n",
"单脚站立 2.19 165\n",
"选择反应时 2.8 165\n"
]
}
],
"source": [ "source": [
"with open(filename,'r') as fl:\n", "with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n", " dict1 = json.load(fl) \n",
@@ -1134,10 +938,123 @@
" print(item,round(score/n,2),n)" " print(item,round(score/n,2),n)"
] ]
}, },
{
"cell_type": "markdown",
"id": "abba5b74-bfcd-4ec0-b682-10170138ff36",
"metadata": {},
"source": [
"### 生成脊椎情况明细"
]
},
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"id": "c840e9b2-ce95-40c5-9f67-438a88ae0736", "id": "da4ba403-92a8-4fd8-8dfc-49802b941fca",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 23,
"id": "aebb4eb4-2bcd-411c-8868-292fae38d8b5",
"metadata": {
"execution": {
"iopub.execute_input": "2023-07-19T05:21:21.489267Z",
"iopub.status.busy": "2023-07-19T05:21:21.488401Z",
"iopub.status.idle": "2023-07-19T05:21:21.503231Z",
"shell.execute_reply": "2023-07-19T05:21:21.502005Z",
"shell.execute_reply.started": "2023-07-19T05:21:21.489227Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'q1': 34, 'q2': 37, 'q3': 32, 'q4': 86, 'q5': 55, 'q6': 33, 'q7': 63, 'q8': 29, 'q9': 59, 'q10': 14, 'q11': 47, 'q12': 58, 'q13': 14, 'q14': 8, 'q15': 54, 'q16': 52, 'q17': 20, 'q18': 54, 'q19': 43, 'q20': 1, 'q21': 31, 'q22': 22, 'q23': 50, 'q24': 10, 'q25': 2}\n"
]
}
],
"source": [
"import json\n",
"import csv\n",
"\n",
"dict1 = {}\n",
"dict2 = {}\n",
"for i in range(1,26):\n",
" dict1[f'q{str(i)}'] = 0\n",
" \n",
"list1 = []\n",
"filename = 'data/Survey_20230719.csv'\n",
"with open(filename,'r',newline='') as csv_file:\n",
" fl = csv.reader(csv_file,delimiter=',')\n",
" header = next(fl) \n",
" for line in fl:\n",
" #line = re.sub('[\\r\\n\\f ]{1,}', '', line)\n",
" list1.append(line)\n",
"list2 = []\n",
"for result in list1:\n",
" data = json.loads(result[5].strip())\n",
" for k, v in data.items():\n",
" if v:\n",
" dict1[k] += 1\n",
"print(dict1) "
]
},
{
"cell_type": "code",
"execution_count": 22,
"id": "ad102064-de18-41aa-9829-b9b398df53d6",
"metadata": {
"execution": {
"iopub.execute_input": "2023-07-19T05:18:48.000423Z",
"iopub.status.busy": "2023-07-19T05:18:47.999556Z",
"iopub.status.idle": "2023-07-19T05:18:48.014467Z",
"shell.execute_reply": "2023-07-19T05:18:48.013436Z",
"shell.execute_reply.started": "2023-07-19T05:18:48.000379Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"['10422', 'zsyxz1', '', '张斌', '35', '{\"q25\":true,\"q1\":false,\"q2\":false,\"q3\":false,\"q4\":true,\"q5\":true,\"q6\":true,\"q7\":true,\"q8\":false,\"q9\":true,\"q10\":false,\"q11\":false,\"q12\":false,\"q13\":false,\"q14\":false,\"q15\":true,\"q16\":false,\"q17\":false,\"q18\":false,\"q19\":true,\"q20\":false,\"q21\":true,\"q22\":false,\"q23\":false,\"q24\":true}', '2023-06-01 20:00:00']\n",
"['10424', 'zsyxz1', '', '余兴见', '85', '{\"q25\":true,\"q1\":false,\"q2\":true,\"q3\":false,\"q4\":true,\"q5\":true,\"q6\":false,\"q7\":true,\"q8\":true,\"q9\":true,\"q10\":false,\"q11\":true,\"q12\":true,\"q13\":false,\"q14\":false,\"q15\":true,\"q16\":true,\"q17\":true,\"q18\":false,\"q19\":false,\"q20\":false,\"q21\":true,\"q22\":true,\"q23\":false,\"q24\":true}', '2023-06-01 20:00:00']\n"
]
}
],
"source": [
"import json\n",
"import csv\n",
"\n",
"dict1 = {}\n",
"dict2 = {}\n",
"for i in range(1,26):\n",
" dict1[f'q{str(i)}'] = 0\n",
" \n",
"list1 = []\n",
"filename = 'data/Survey_20230719.csv'\n",
"with open(filename,'r',newline='') as csv_file:\n",
" fl = csv.reader(csv_file,delimiter=',')\n",
" header = next(fl) \n",
" for line in fl:\n",
" #line = re.sub('[\\r\\n\\f ]{1,}', '', line)\n",
" list1.append(line)\n",
"list2 = []\n",
"for result in list1:\n",
" data = json.loads(result[5].strip())\n",
" for k, v in data.items():\n",
" if k == 'q25'and v:\n",
" print(result)\n",
"#print(dict1) "
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2787bc9f-6492-4b51-9b37-87ac098d93b9",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [] "source": []
@@ -1159,7 +1076,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.10.6" "version": "3.10.12"
} }
}, },
"nbformat": 4, "nbformat": 4,
File diff suppressed because it is too large. Load diff
+22 -4
View File
@@ -159,15 +159,33 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": 1,
"metadata": { "metadata": {
"execution": {
"iopub.execute_input": "2023-08-29T03:26:35.055593Z",
"iopub.status.busy": "2023-08-29T03:26:35.055086Z",
"iopub.status.idle": "2023-08-29T03:26:35.077483Z",
"shell.execute_reply": "2023-08-29T03:26:35.076400Z",
"shell.execute_reply.started": "2023-08-29T03:26:35.055541Z"
},
"tags": [] "tags": []
}, },
"outputs": [], "outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"bs b'\\xd4\\xc0\\xcd\\xaf'\n",
"decode-bs: 岳童\n",
"gbcode: b'\\xc2\\xed\\xc1\\xa2\\xd1\\xc7'\n",
"gbs: c2edc1a2d1c7\n"
]
}
],
"source": [ "source": [
"import binascii\n", "import binascii\n",
"\n", "\n",
"gbs = 'C0EEB574'\n", "gbs = 'D4C0CDAF'\n",
"bs = binascii.a2b_hex(gbs)\n", "bs = binascii.a2b_hex(gbs)\n",
"print('bs', bs)\n", "print('bs', bs)\n",
"print('decode-bs:', bs.decode('gbk'))\n", "print('decode-bs:', bs.decode('gbk'))\n",
@@ -1440,7 +1458,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.10.6" "version": "3.10.12"
} }
}, },
"nbformat": 4, "nbformat": 4,
+1 -1
View File
@@ -1247,7 +1247,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.10.6" "version": "3.10.12"
} }
}, },
"nbformat": 4, "nbformat": 4,
+1 -1
View File
@@ -1344,7 +1344,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.10.6" "version": "3.10.12"
} }
}, },
"nbformat": 4, "nbformat": 4,