This commit is contained in:
512song committed 2023-11-27 17:54:04 +08:00
1 parent 3b4acc857c
commit 2d6db59b1c
4 files changed
+350 -117

No files matched your search

+61 -15
View File
@@ -280,12 +280,28 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 51,
"id": "3e614f4a-a623-48e2-97f8-b31f62c9a983",
"metadata": {
"execution": {
"iopub.execute_input": "2023-11-26T12:33:04.366772Z",
"iopub.status.busy": "2023-11-26T12:33:04.366311Z",
"iopub.status.idle": "2023-11-26T12:33:04.395519Z",
"shell.execute_reply": "2023-11-26T12:33:04.394381Z",
"shell.execute_reply.started": "2023-11-26T12:33:04.366735Z"
},
"tags": []
},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"16\n",
"16\n"
]
}
],
"source": [
"import json\n",
"import datetime\n",
@@ -315,11 +331,11 @@
"re_ta = {}\n",
"dict1 = {}\n",
"list1 = []\n",
"filename = 'data/北海炼化2023年.json'\n",
"filename = 'data/北京党校.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"\n",
"filename = 'data/places_result_20231119.csv'\n",
"filename = 'data/places_result_20231126.csv'\n",
"with open(filename,'r',newline='') as csv_file:\n",
" fl = csv.reader(csv_file,delimiter=',')\n",
" header = next(fl) \n",
@@ -359,7 +375,7 @@
" 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_北海炼化2023.json'\n",
"filename = 'data/result_北京党校20231126.json'\n",
"\n",
"with open(filename,'w') as fl:\n",
" json.dump(re_ta, fl, ensure_ascii=False) \n",
@@ -376,12 +392,27 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 52,
"id": "141b30dc-5975-4dcb-9bc3-9b20d26a0917",
"metadata": {
"execution": {
"iopub.execute_input": "2023-11-26T12:33:25.037310Z",
"iopub.status.busy": "2023-11-26T12:33:25.036852Z",
"iopub.status.idle": "2023-11-26T12:33:25.068487Z",
"shell.execute_reply": "2023-11-26T12:33:25.068065Z",
"shell.execute_reply.started": "2023-11-26T12:33:25.037274Z"
},
"tags": []
},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"ok!\n"
]
}
],
"source": [
"import json\n",
"import time\n",
@@ -479,7 +510,7 @@
"\n",
"#list_item = ['lung','grip','flexion','jump','pushup','balance','reaction','step','situp','height','weight']\n",
"list_item = ['lung','grip','flexion','jump','pushup','balance','reaction','step','situp']\n",
"filename = 'data/result_北海炼化2023.json'\n",
"filename = 'data/result_北京党校20231126.json'\n",
"with open(filename,'r') as fl:\n",
" dict2 = json.load(fl) \n",
"for k, v in dict2.items():\n",
@@ -500,7 +531,7 @@
" dict2[k][item_en]['score'] = cal_score(data1)\n",
" #print(k,v[item_en]['成绩'],cal_score(data1))\n",
"\n",
"filename = f'data/result_北海炼化2023.json'\n",
"filename = f'data/result_北京党校20231126.json'\n",
"with open(filename,'w') as fl:\n",
" json.dump(dict2,fl , ensure_ascii=False) \n",
"print('ok!') "
@@ -557,12 +588,27 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 54,
"id": "b123ee6b-85d2-4660-b226-321832a6b796",
"metadata": {
"execution": {
"iopub.execute_input": "2023-11-26T12:39:01.504677Z",
"iopub.status.busy": "2023-11-26T12:39:01.504412Z",
"iopub.status.idle": "2023-11-26T12:39:07.037937Z",
"shell.execute_reply": "2023-11-26T12:39:07.036619Z",
"shell.execute_reply.started": "2023-11-26T12:39:01.504657Z"
},
"tags": []
},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"17\n"
]
}
],
"source": [
"import requests\n",
"import json\n",
@@ -572,11 +618,11 @@
"headers = {\n",
" \"Content-Type\": \"application/json; charset=UTF-8\"\n",
" }\n",
"filename = 'data/result_天津231017.json'\n",
"filename = 'data/result_北京党校20231126.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl)\n",
"list1 = []\n",
"fiie_path ='./134/'\n",
"fiie_path ='./中央和国家机关党校1126/'\n",
"list_item = ['lung','grip','flexion','jump','pushup','balance','reaction','step','situp','bmi']\n",
"i=1\n",
"list2 = []\n",
@@ -584,9 +630,9 @@
" list1 = []\n",
" mydata = {}\n",
" \n",
" id = str(k).rjust(8,\"0\")\n",
" id = str(k).rjust(4,\"0\")\n",
" mydata['path'] = fiie_path+id+'-'+ v['name']+'.pdf'\n",
" mydata['title'] = '中石化(天津)石油化工\\n有限公司'\n",
" mydata['title'] = '中央和国家机关党校'\n",
" mydata['subtitle'] = v['unit']\n",
" mydata['id'] = id\n",
" mydata['name'] = v['name']\n",