20230525
This commit is contained in:
1 parent
91ae3fce79
commit
8242dc00aa
5 files changed
+745
-478
No files matched your search
+520
@@ -0,0 +1,520 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "ba2deee7-9c63-4115-bcee-ad341175fc02",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 人员信息导入"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "dea5e486-6927-469f-aa57-e5efac4670be",
|
||||
"metadata": {
|
||||
"tags": []
|
||||
},
|
||||
"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, 2).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, 1).value\n",
|
||||
" if sheet.cell(n,10).value is not None:\n",
|
||||
" dict1['phone'] = sheet.cell(n, 10).value \n",
|
||||
" person[code] = dict1\n",
|
||||
"\n",
|
||||
"filename = 'data/北京农行人员名单.json'\n",
|
||||
"with open(filename, 'w') as fl:\n",
|
||||
" json.dump(person, fl, ensure_ascii=False)\n",
|
||||
"print('ok')"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "1c00e1e4-101a-4e9f-a7ed-9c65200d19df",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 成绩导入"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "fd73b8be-d3fe-49aa-99d2-3cc6df4a3eb0",
|
||||
"metadata": {
|
||||
"tags": []
|
||||
},
|
||||
"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/北京农行人员名单.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl) \n",
|
||||
"\n",
|
||||
"filename = 'data/places_result_20230521.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_北京农行.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": "928790e6-d8a4-4b2b-852a-3c323380a80f",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 成绩导出"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "b870bd6e-f972-4073-b13d-5fda8cc92bb7",
|
||||
"metadata": {
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import openpyxl\n",
|
||||
"\n",
|
||||
"items = ['身高','体重','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数']\n",
|
||||
"title = ['编号','姓名','性别','单位','身高','体重','肺活量','握力','坐位体前屈','纵跳','俯卧撑','一分钟仰卧起坐','单脚站立','选择反应时','台阶指数']\n",
|
||||
"\n",
|
||||
"filename = 'data/result_北京农行.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"\n",
|
||||
"filename = 'data/北京农行人员名单.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict2 = json.load(fl)\n",
|
||||
" \n",
|
||||
"list1 = []\n",
|
||||
"for k, v in dict1.items():\n",
|
||||
" list2 = []\n",
|
||||
" list2.append(str(k).rjust(5,'0'))\n",
|
||||
" list2.append(v['name']) \n",
|
||||
" list2.append(dict2[k]['sex'])\n",
|
||||
" list2.append(dict2[k]['unit'])\n",
|
||||
" for item in items:\n",
|
||||
" if item in v.keys():\n",
|
||||
" list2.append(v[item]['成绩']) \n",
|
||||
" elif item =='name':\n",
|
||||
" list2.append(v[item])\n",
|
||||
" else:\n",
|
||||
" list2.append('') \n",
|
||||
" list1.append(list2)\n",
|
||||
"filename = 'data/北京农行体测情况.xlsx'\n",
|
||||
"wb = openpyxl.Workbook()\n",
|
||||
"sheet = wb.active\n",
|
||||
"sheet.append(title)\n",
|
||||
"for row in list1:\n",
|
||||
" sheet.append(row)\n",
|
||||
" \n",
|
||||
"wb.save(filename)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "dd2034ca-fe8b-4322-b06d-8c5eaf96373d",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 报告按部门分类更名"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "04967ec6-b9a0-4097-9e1f-8beaf8a9e75f",
|
||||
"metadata": {
|
||||
"tags": []
|
||||
},
|
||||
"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-05-23'\n",
|
||||
"old = []\n",
|
||||
"dict2 = {}\n",
|
||||
"\n",
|
||||
"filename = 'data/result_北京农行.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",
|
||||
" m_depart = v['unit'] \n",
|
||||
" dict2[int(k)] = [m_name,m_depart]\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',dict1[n]['unit'])\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",
|
||||
"id": "515bc854-5745-4c38-8633-f56a078ea9a8",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-05-25T09:28:28.615647Z",
|
||||
"iopub.status.busy": "2023-05-25T09:28:28.614774Z",
|
||||
"iopub.status.idle": "2023-05-25T09:28:28.619865Z",
|
||||
"shell.execute_reply": "2023-05-25T09:28:28.618821Z",
|
||||
"shell.execute_reply.started": "2023-05-25T09:28:28.615607Z"
|
||||
}
|
||||
},
|
||||
"source": [
|
||||
"## 生成人员电话信息表"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 26,
|
||||
"id": "c925d850-ff06-4be5-bf9f-31f4385c37c0",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-05-25T09:39:32.123643Z",
|
||||
"iopub.status.busy": "2023-05-25T09:39:32.122802Z",
|
||||
"iopub.status.idle": "2023-05-25T09:39:32.189169Z",
|
||||
"shell.execute_reply": "2023-05-25T09:39:32.188132Z",
|
||||
"shell.execute_reply.started": "2023-05-25T09:39:32.123602Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"162\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import json\n",
|
||||
"import openpyxl\n",
|
||||
"wb = openpyxl.load_workbook('data/农业银行测试手机号码统计表.xlsx')\n",
|
||||
"sheet = wb.active\n",
|
||||
"# sheets = wb.sheetnames\n",
|
||||
"dict1 = {}\n",
|
||||
"\n",
|
||||
"for n in range(2, sheet.max_row+1):\n",
|
||||
" if sheet.cell(n,5).value is not None:\n",
|
||||
" phone = str(sheet.cell(n, 5).value)\n",
|
||||
" dict1.setdefault(phone,{})\n",
|
||||
" code = str(sheet.cell(n, 2).value)\n",
|
||||
" unit = sheet.cell(n, 1).value\n",
|
||||
" name = sheet.cell(n, 3).value\n",
|
||||
" sex = sheet.cell(n, 4).value\n",
|
||||
" dict1[phone]['code'] = code\n",
|
||||
" dict1[phone]['name'] = name\n",
|
||||
" #dict1[phone]['unit'] = unit\n",
|
||||
" #dict1[phone]['sex'] = sex\n",
|
||||
"filename = 'data/农业银行测试手机号码.json'\n",
|
||||
"\n",
|
||||
"with open(filename,'w') as fl:\n",
|
||||
" json.dump(dict1, fl, ensure_ascii=False) \n",
|
||||
"print(len(dict1))\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "0f13e837-15d9-4dc6-b356-78b79bbb5b17",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 生成验证码"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 35,
|
||||
"id": "a87384c6-dc46-4d09-b757-b42462ed818d",
|
||||
"metadata": {
|
||||
"execution": {
|
||||
"iopub.execute_input": "2023-05-25T09:51:28.611776Z",
|
||||
"iopub.status.busy": "2023-05-25T09:51:28.610914Z",
|
||||
"iopub.status.idle": "2023-05-25T09:51:28.626319Z",
|
||||
"shell.execute_reply": "2023-05-25T09:51:28.625266Z",
|
||||
"shell.execute_reply.started": "2023-05-25T09:51:28.611734Z"
|
||||
},
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"162\n",
|
||||
"['6085', '5304', '3071', '8954', '4051', '2348', '7629', '3607', '2095', '8107', '7905', '2791', '8460', '5096', '4062', '1978', '0976', '8492', '0197', '0287', '3764', '6589', '5439', '5607', '0541', '8629', '3275', '7620', '4795', '3025', '5862', '5410', '1438', '2408', '2167', '1094', '4026', '3184', '9104', '7694', '1862', '7286', '6170', '6578', '6587', '5179', '2043', '4813', '2597', '3207', '6859', '8920', '1268', '4860', '9627', '2918', '3841', '4193', '9281', '7961', '3510', '6912', '4921', '7520', '8930', '8271', '2163', '3457', '8713', '1962', '7480', '4138', '2504', '7490', '7285', '4029', '2496', '4920', '3572', '9305', '7512', '6324', '5731', '4719', '6895', '4591', '0679', '5287', '3817', '4063', '2108', '9153', '2401', '2897', '6782', '3875', '8014', '4753', '2146', '2483', '5012', '5803', '9425', '3578', '5628', '9245', '4835', '7052', '8654', '3586', '1693', '3086', '7609', '3021', '1794', '2865', '1739', '7435', '4135', '5240', '0374', '6583', '0856', '0812', '5837', '7106', '0268', '8376', '5346', '0753', '4158', '1756', '2473', '6139', '3178', '7824', '3201', '6304', '6109', '0735', '8573', '9857', '3240', '5340', '0438', '7415', '2783', '3127', '5497', '8542', '9764', '6107', '9016', '0248', '2195', '5149', '7982', '4750', '4023', '9684', '0823', '0692']\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import random\n",
|
||||
"import json\n",
|
||||
"\n",
|
||||
"code_list = []\n",
|
||||
"for i in range(10): # 0~9\n",
|
||||
" code_list.append(str(i))\n",
|
||||
" \n",
|
||||
"list1 = []\n",
|
||||
"#print(code_num)\n",
|
||||
"i = 1\n",
|
||||
"while i < 163:\n",
|
||||
" code = random.sample(code_list,4) #随机取6位数\n",
|
||||
" code_num = ''.join(code)\n",
|
||||
" if code_num not in list1:\n",
|
||||
" list1.append(code_num)\n",
|
||||
" i +=1\n",
|
||||
"print(len(list1))\n",
|
||||
"print(list1)\n",
|
||||
"i = 0\n",
|
||||
"filename = 'data/农业银行测试手机号码.json'\n",
|
||||
"with open(filename,'r') as fl:\n",
|
||||
" dict1 = json.load(fl)\n",
|
||||
"for k, v in dict1.items():\n",
|
||||
" dict1[k]['yzm'] = list1[i]\n",
|
||||
" i +=1\n",
|
||||
"with open(filename,'w') as fl:\n",
|
||||
" json.dump(dict1, fl, ensure_ascii=False) "
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"id": "fba0a0c4-edf2-45c2-9199-c6a86919f191",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"## 发送短信"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 37,
|
||||
"id": "62733f52-62c1-43aa-964a-232eab8b5251",
|
||||
"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": []
|
||||
},
|
||||
"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": [
|
||||
"from tencentcloud.common import credential\n",
|
||||
"from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException\n",
|
||||
"from tencentcloud.sms.v20210111 import sms_client, models\n",
|
||||
"\n",
|
||||
"# 导入可选配置类\n",
|
||||
"from tencentcloud.common.profile.client_profile import ClientProfile\n",
|
||||
"from tencentcloud.common.profile.http_profile import HttpProfile\n",
|
||||
"try: \n",
|
||||
" secretId = \"AKID22rVyvSqbikXFFvav31ykc9YmqjN6KYc\"\n",
|
||||
" secretKey = \"51XVL1YxDKI6mJh8au6DDuTskS1RhwJX\"\n",
|
||||
" cred = credential.Credential(secretId, secretKey)\n",
|
||||
" \n",
|
||||
"\n",
|
||||
" # 实例化一个http选项,可选的,没有特殊需求可以跳过。\n",
|
||||
" httpProfile = HttpProfile()\n",
|
||||
" # 如果需要指定proxy访问接口,可以按照如下方式初始化hp(无需要直接忽略)\n",
|
||||
" # httpProfile = HttpProfile(proxy=\"http://用户名:密码@代理IP:代理端口\")\n",
|
||||
" httpProfile.reqMethod = \"POST\" # post请求(默认为post请求)\n",
|
||||
" httpProfile.reqTimeout = 30 # 请求超时时间,单位为秒(默认60秒)\n",
|
||||
" httpProfile.endpoint = \"sms.tencentcloudapi.com\" # 指定接入地域域名(默认就近接入)\n",
|
||||
"\n",
|
||||
" # 非必要步骤:\n",
|
||||
" # 实例化一个客户端配置对象,可以指定超时时间等配置\n",
|
||||
" clientProfile = ClientProfile()\n",
|
||||
" clientProfile.signMethod = \"TC3-HMAC-SHA256\" # 指定签名算法\n",
|
||||
" clientProfile.language = \"en-US\"\n",
|
||||
" clientProfile.httpProfile = httpProfile\n",
|
||||
"\n",
|
||||
" # 实例化要请求产品(以sms为例)的client对象\n",
|
||||
" # 第二个参数是地域信息,可以直接填写字符串ap-guangzhou,支持的地域列表参考 https://cloud.tencent.com/document/api/382/52071#.E5.9C.B0.E5.9F.9F.E5.88.97.E8.A1.A8\n",
|
||||
" client = sms_client.SmsClient(cred, \"ap-guangzhou\", clientProfile)\n",
|
||||
" req = models.SendSmsRequest()\n",
|
||||
"\n",
|
||||
" \n",
|
||||
" # 短信应用ID: 短信SdkAppId在 [短信控制台] 添加应用后生成的实际SdkAppId,示例如1400006666\n",
|
||||
" # 应用 ID 可前往 [短信控制台](https://console.cloud.tencent.com/smsv2/app-manage) 查看\n",
|
||||
" req.SmsSdkAppId = \"1400140089\"\n",
|
||||
" # 短信签名内容: 使用 UTF-8 编码,必须填写已审核通过的签名\n",
|
||||
" # 签名信息可前往 [国内短信](https://console.cloud.tencent.com/smsv2/csms-sign) 或 [国际/港澳台短信](https://console.cloud.tencent.com/smsv2/isms-sign) 的签名管理查看\n",
|
||||
" req.SignName = \"坤铭教育\"\n",
|
||||
" # 模板 ID: 必须填写已审核通过的模板 ID\n",
|
||||
" # 模板 ID 可前往 [国内短信](https://console.cloud.tencent.com/smsv2/csms-template) 或 [国际/港澳台短信](https://console.cloud.tencent.com/smsv2/isms-template) 的正文模板管理查看\n",
|
||||
" req.TemplateId = \"1808914\"\n",
|
||||
" # 模板参数: 模板参数的个数需要与 TemplateId 对应模板的变量个数保持一致,,若无模板参数,则设置为空\n",
|
||||
" req.TemplateParamSet = [\"1234\"]\n",
|
||||
" # 下发手机号码,采用 E.164 标准,+[国家或地区码][手机号]\n",
|
||||
" # 示例如:+8613711112222, 其中前面有一个+号 ,86为国家码,13711112222为手机号,最多不要超过200个手机号\n",
|
||||
" req.PhoneNumberSet = [\"+8613793180751\"]\n",
|
||||
" # 用户的 session 内容(无需要可忽略): 可以携带用户侧 ID 等上下文信息,server 会原样返回\n",
|
||||
" req.SessionContext = \"\"\n",
|
||||
" # 短信码号扩展号(无需要可忽略): 默认未开通,如需开通请联系 [腾讯云短信小助手]\n",
|
||||
" req.ExtendCode = \"\"\n",
|
||||
" # 国内短信无需填写该项;国际/港澳台短信已申请独立 SenderId 需要填写该字段,默认使用公共 SenderId,无需填写该字段。注:月度使用量达到指定量级可申请独立 SenderId 使用,详情请联系 [腾讯云短信小助手](https://cloud.tencent.com/document/product/382/3773#.E6.8A.80.E6.9C.AF.E4.BA.A4.E6.B5.81)。\n",
|
||||
" req.SenderId = \"\"\n",
|
||||
"\n",
|
||||
" resp = client.SendSms(req)\n",
|
||||
"\n",
|
||||
" # 输出json格式的字符串回包\n",
|
||||
" print(resp.to_json_string(indent=2))\n",
|
||||
"\n",
|
||||
"except TencentCloudSDKException as err:\n",
|
||||
" print(err)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 41,
|
||||
"id": "e924a0a9-65a5-49c4-bdf2-b9152d278ad5",
|
||||
"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": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"send success\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"dict1 = json.loads(resp.to_json_string(indent=2))\n",
|
||||
"print(dict1['SendStatusSet'][0][\"Message\"])"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "90242d3b-c719-4c23-a3e8-a718f86b14f3",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3 (ipykernel)",
|
||||
"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.10.6"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 5
|
||||
}
|
||||
Reference in new issue
Block a user