This commit is contained in:
512song committed 2024-09-18 10:19:45 +08:00
1 parent 724bf28fbf
commit 63f678daf4
9 files changed
+923 -224

No files matched your search

+1 -1
View File
@@ -1404,7 +1404,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
"version": "3.12.3"
}
},
"nbformat": 4,
+297 -40
View File
@@ -10,34 +10,49 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"id": "bbba6efc-73cd-4db6-bae7-014724fee731",
"metadata": {
"execution": {
"iopub.execute_input": "2024-09-18T02:16:02.586698Z",
"iopub.status.busy": "2024-09-18T02:16:02.585914Z",
"iopub.status.idle": "2024-09-18T02:16:02.620560Z",
"shell.execute_reply": "2024-09-18T02:16:02.620084Z",
"shell.execute_reply.started": "2024-09-18T02:16:02.586621Z"
},
"tags": []
},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"ok\n"
]
}
],
"source": [
"import openpyxl\n",
"import json\n",
"from datetime import date\n",
"\n",
"wb = openpyxl.load_workbook('data/东营老年大学.xlsx')\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",
"for n in range(1, sheet.max_row+1):\n",
" code = int(sheet.cell(n, 1).value)\n",
" person.setdefault(code, {})\n",
" dict1 = {}\n",
" dict1['name'] = sheet.cell(n, 2).value\n",
" dict1['sex'] = sheet.cell(n, 4).value\n",
" dict1['unit'] = '东营老年大学'\n",
" dict1['birth'] = str(sheet.cell(n, 8).value).replace('/','-').split(' ')[0]\n",
" if sheet.cell(n,6).value is not None:\n",
" dict1['phone'] = str(sheet.cell(n,6).value) \n",
" dict1['sex'] = sheet.cell(n, 3).value\n",
" dict1['unit'] = '北体体质康健班'\n",
" dict1['birth'] = str(sheet.cell(n, 4).value).replace('/','-').split(' ')[0]\n",
" if sheet.cell(n,5).value is not None:\n",
" dict1['phone'] = str(sheet.cell(n,5).value) \n",
" person[code] = dict1\n",
"filename = 'data/东营老年大学.json'\n",
"filename = 'data/北体体质康健.json'\n",
"with open(filename, 'w') as fl:\n",
" json.dump(person, fl, ensure_ascii=False)\n",
"print('ok')"
@@ -53,12 +68,28 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"id": "970e171e-1360-448f-a28c-520ccb8f314a",
"metadata": {
"execution": {
"iopub.execute_input": "2024-09-18T02:17:10.941442Z",
"iopub.status.busy": "2024-09-18T02:17:10.940669Z",
"iopub.status.idle": "2024-09-18T02:17:10.997800Z",
"shell.execute_reply": "2024-09-18T02:17:10.997322Z",
"shell.execute_reply.started": "2024-09-18T02:17:10.941368Z"
},
"tags": []
},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"87\n",
"87\n"
]
}
],
"source": [
"import json\n",
"import datetime\n",
@@ -88,11 +119,11 @@
"re_ta = {}\n",
"dict1 = {}\n",
"list1 = []\n",
"filename = 'data/东营老年大学.json'\n",
"filename = 'data/北体体质康健.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"\n",
"filename = 'data/places_result_20240321.csv'\n",
"filename = 'data/places_result_20240918.csv'\n",
"with open(filename,'r',newline='') as csv_file:\n",
" fl = csv.reader(csv_file,delimiter=',')\n",
" header = next(fl) \n",
@@ -135,7 +166,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_东营老年大学.json'\n",
"filename = 'data/result_北体体质康健.json'\n",
"\n",
"with open(filename,'w') as fl:\n",
" json.dump(re_ta, fl, ensure_ascii=False) \n",
@@ -224,9 +255,16 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 24,
"id": "79fb7799-3693-4b7b-ae82-c0d8dee98d36",
"metadata": {
"execution": {
"iopub.execute_input": "2024-09-14T11:49:21.331114Z",
"iopub.status.busy": "2024-09-14T11:49:21.330310Z",
"iopub.status.idle": "2024-09-14T11:49:21.362941Z",
"shell.execute_reply": "2024-09-14T11:49:21.362399Z",
"shell.execute_reply.started": "2024-09-14T11:49:21.331031Z"
},
"tags": []
},
"outputs": [],
@@ -239,13 +277,13 @@
"\n",
"dict1 = {}\n",
"\n",
"filename = 'data/result_东营老年大学.json'\n",
"filename = 'data/result_北体体质康健.json'\n",
"with open(filename,'r') as fl:\n",
" dict3 = json.load(fl)\n",
"\n",
"\n",
"list1 = []\n",
"filename = 'data/Survey_20240321.csv'\n",
"filename = 'data/Survey_20240914.csv'\n",
"with open(filename,'r',newline='') as csv_file:\n",
" fl = csv.reader(csv_file,delimiter=',')\n",
" header = next(fl) \n",
@@ -331,7 +369,7 @@
" \n",
" dict1[k1]['rq'] = item[6].replace('/','-').split(' ')[0]\n",
"#print(dict1)\n",
"filename = 'data/result_东营老年大学1.json'\n",
"filename = 'data/result_北体体质康健1.json'\n",
"\n",
"with open(filename,'w') as fl:\n",
" json.dump(dict1, fl, ensure_ascii=False) "
@@ -641,27 +679,10 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": null,
"id": "bd4b91e9-289c-4f21-aab6-846b5f98c493",
"metadata": {
"execution": {
"iopub.execute_input": "2024-06-24T01:27:12.789785Z",
"iopub.status.busy": "2024-06-24T01:27:12.788991Z",
"iopub.status.idle": "2024-06-24T01:27:12.935728Z",
"shell.execute_reply": "2024-06-24T01:27:12.935118Z",
"shell.execute_reply.started": "2024-06-24T01:27:12.789716Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"刘明岐\n",
"{13375466638: '刘秀清', 13589432668: '赵福珍', 13054619993: '王玉秀', 18554686537: '陈静', 15805460500: '王建红', 13705468382: '丁寿亭', 18654618688: '扈继梅', '18905463888': '崔建民', 13505466886: '郝桂荣', 13361529316: '许兴华', 18654605758: '李新建', 13963369251: '王秀娥', 13854666193: '胡希茹', 13963381767: '曹玉松', 13562277783: '王华奎', 13854664965: '刘学农', 18506464679: '缪新军', 18865467010: '刘汝香', 18505460998: '胡建营', 15266083778: '张玉芹', 15865469239: '刘晋秀', 15154607897: '赵庆芬', 13963359091: '李新国', 13685469953: '王巧云', 18615463569: '李克杰', '13054610560': '马国丽', 13518666896: '刘国明', 13668615983: '李泽国', 13562269069: '邓文霞', 15066075216: '李长君', 18754687658: '王占敏', 13668618731: '刘晓芳', 15552721566: '乔晓雪', 18678690907: '杨学荣', 13082610996: '张德全', 13563351026: '李承俊', 13506369296: '王新玲', 13589986263: '赵立生', 13589996697: '李钦德', 18905465618: '刘其科', 18954035397: '刘建兴', 13906472659: '尚国勋', 15618032716: '林娟', 18661382930: '朱玉良', 13505465335: '邱永明', '13012914968': '赵玉环', 13854622388: '周敏', 13589961161: '许明', 18860657259: '王芳红', 13963358011: '刘兆作', 13605466080: '薛永华', '13280370107': '于敏', 13505461565: '胡建忠', 15550539718: '南莉莉', 15698085191: '刘明岐', 18562110866: '劳玉霞', '18866683285': '张金凤', 13376472932: '王本学', 18653690626: '李萍', 13515466253: '成桂艳', 13054652092: '卢霞', 13280380156: '肖东炎', 18254621588: '黄广红', '15216470927': '李爱萍', 13854620482: '王玉芹', 13376473932: '宋玉香', 18654335533: '刘明华', 16605466518: '靳娜', 13706364787: '李春梅', '13854656568': '吴承军', '13792099139': '宋金乐', '18562022520': '鞠栋', '18605469525': '刘宗敏'}\n"
]
}
],
"metadata": {},
"outputs": [],
"source": [
"%reset -f\n",
"\n",
@@ -691,10 +712,246 @@
"print(dict2) "
]
},
{
"cell_type": "markdown",
"id": "dacbf0e8-f456-478f-8253-2824d68d092c",
"metadata": {},
"source": [
"## 合并分日测试信息"
]
},
{
"cell_type": "code",
"execution_count": 30,
"id": "162364f8-8ae9-4bbb-8fb1-e9181ececf02",
"metadata": {
"execution": {
"iopub.execute_input": "2024-09-14T12:37:55.393433Z",
"iopub.status.busy": "2024-09-14T12:37:55.392657Z",
"iopub.status.idle": "2024-09-14T12:37:55.424141Z",
"shell.execute_reply": "2024-09-14T12:37:55.423583Z",
"shell.execute_reply.started": "2024-09-14T12:37:55.393359Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"170\n"
]
}
],
"source": [
"import json\n",
"from datetime import date\n",
"\n",
"filename = 'data/result_北体体质康健1.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"filename = 'data/result_北体体质康健2.json'\n",
"with open(filename,'r') as fl:\n",
" dict2 = json.load(fl) \n",
"\n",
"n = 50\n",
"for k, v in dict2.items():\n",
" dict1[n+int(k)] = v\n",
" \n",
"filename = 'data/result_北体体质康健.json'\n",
"with open(filename,'w') as fl:\n",
" json.dump(dict1, fl, ensure_ascii=False) \n",
"print(len(dict1))"
]
},
{
"cell_type": "markdown",
"id": "ddda3101-052a-45c5-87af-65333b4ba141",
"metadata": {},
"source": [
"## 补充问卷人员信息"
]
},
{
"cell_type": "code",
"execution_count": 29,
"id": "8e025cb5-8c9f-4eb9-a66e-863df32881c8",
"metadata": {
"execution": {
"iopub.execute_input": "2024-09-14T12:37:09.151657Z",
"iopub.status.busy": "2024-09-14T12:37:09.150889Z",
"iopub.status.idle": "2024-09-14T12:37:09.186568Z",
"shell.execute_reply": "2024-09-14T12:37:09.186032Z",
"shell.execute_reply.started": "2024-09-14T12:37:09.151586Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"ok\n"
]
}
],
"source": [
"import openpyxl\n",
"import json\n",
"from datetime import date\n",
"\n",
"wb = openpyxl.load_workbook('data/北体体质康健.xlsx')\n",
"sheet = wb.active\n",
"filename = 'data/result_北体体质康健.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"filename = 'data/北体体质康健.json'\n",
"with open(filename,'r') as fl:\n",
" dict2 = json.load(fl) \n",
"for n in range(1, sheet.max_row+1):\n",
" code = str(sheet.cell(n, 1).value)\n",
" if code in dict1.keys(): \n",
" if sheet.cell(n,5).value is not None:\n",
" dict1[code]['phone'] = str(sheet.cell(n,5).value)\n",
" else:\n",
" dict1[code]= dict2[code]\n",
" rq = '2024-09-14'\n",
" birth = dict2[code]['birth']\n",
" days = (rq-birth).days \n",
" dict1[code]['age'] = int(days/365)\n",
" dict1[code]['month'] = int(days/365*12)\n",
" \n",
"filename = 'data/result_北体体质康健.json'\n",
"with open(filename, 'w') as fl:\n",
" json.dump(dict1, fl, ensure_ascii=False)\n",
"print('ok')"
]
},
{
"cell_type": "code",
"execution_count": 33,
"id": "ef75192e-a6ec-4d72-88b4-7645ce6d0aed",
"metadata": {
"execution": {
"iopub.execute_input": "2024-09-14T12:43:31.977618Z",
"iopub.status.busy": "2024-09-14T12:43:31.976867Z",
"iopub.status.idle": "2024-09-14T12:43:31.999628Z",
"shell.execute_reply": "2024-09-14T12:43:31.999148Z",
"shell.execute_reply.started": "2024-09-14T12:43:31.977549Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"ok\n"
]
}
],
"source": [
"import json\n",
"from datetime import date\n",
"filename = 'data/result_北体体质康健2.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl) \n",
"for k,v in dict1.items():\n",
" if 'month' not in v.keys():\n",
" rq = date.fromisoformat(v['rq'])\n",
" birth = date.fromisoformat(v['birth'])\n",
" days = (rq-birth).days \n",
" dict1[k]['age'] = int(days/365)\n",
" dict1[k]['month'] = int(days/365*12)\n",
"with open(filename, 'w') as fl:\n",
" json.dump(dict1, fl, ensure_ascii=False)\n",
"print('ok') "
]
},
{
"cell_type": "code",
"execution_count": 36,
"id": "99c612c8-aa47-4ed8-b866-c8d2edcaea4b",
"metadata": {
"execution": {
"iopub.execute_input": "2024-09-14T12:45:56.907974Z",
"iopub.status.busy": "2024-09-14T12:45:56.907231Z",
"iopub.status.idle": "2024-09-14T12:46:35.198207Z",
"shell.execute_reply": "2024-09-14T12:46:35.197069Z",
"shell.execute_reply.started": "2024-09-14T12:45:56.907903Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"79\n"
]
}
],
"source": [
"import requests\n",
"import json\n",
"import openpyxl\n",
"\n",
"\n",
"headers = {\n",
" \"Content-Type\": \"application/json; charset=UTF-8\"\n",
" }\n",
"filename = 'data/result_北体体质康健2.json'\n",
"with open(filename,'r') as fl:\n",
" dict1 = json.load(fl)\n",
"list1 = []\n",
"file_path ='./北体体质康健班/'\n",
"list_item = ['lung','grip','flexion','jump','pushup','balance','reaction','step','situp','bmi']\n",
"i=0\n",
"list2 = []\n",
"for k, v in dict1.items():\n",
" list1 = []\n",
" mydata = {}\n",
" \n",
" id = str(k).rjust(4,\"0\")\n",
" mydata['path'] = file_path+id+'-'+ v['name']+'.pdf'\n",
" mydata['title'] = '北体体质康健班'\n",
" mydata['subtitle'] = ''\n",
" mydata['id'] = id\n",
" mydata['name'] = v['name']\n",
" if v['sex'] == '男':\n",
" mydata['gender'] = 'male'\n",
" else:\n",
" mydata['gender'] = 'female'\n",
" \n",
" mydata['month'] = v['month']\n",
" mydata['fits'] = {}\n",
" survey_list = ['tcm','psy','spine']\n",
" for item in survey_list:\n",
" if item in v.keys():\n",
" mydata.setdefault('surveys',{})\n",
" mydata['surveys'][item] = v[item]\n",
" \n",
" \n",
" #mydata['fits'] = {}\n",
" for item in list_item:\n",
" if item in v.keys():\n",
" mydata.setdefault('fits',{})\n",
" if item in ['lung','pushup','step','situp']:\n",
" mark = v[item]['成绩'].split()[0].split('.')[0]\n",
" else:\n",
" mark = v[item]['成绩'].split()[0]\n",
" mydata['fits'][item] = {'mark':mark,'score':v[item]['score']}\n",
" if len(mydata['fits']) >2 : \n",
" list1.append(mydata)\n",
" list2.append([k,v['name']])\n",
" i+=1\n",
" x = requests.post('http://localhost:3003', data = json.dumps(list1), headers=headers)\n",
" #print(id,v['name'],x.text)\n",
" #print(mydata)\n",
" #x.close()\n",
"print(i)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "d52f6b08-a9dd-47db-a823-791d581e3e6b",
"id": "1e617679-6d57-4389-bc84-4e14e63616f1",
"metadata": {},
"outputs": [],
"source": []
+8 -8
View File
@@ -544,15 +544,15 @@
},
{
"cell_type": "code",
"execution_count": 40,
"execution_count": 2,
"id": "141b30dc-5975-4dcb-9bc3-9b20d26a0917",
"metadata": {
"execution": {
"iopub.execute_input": "2024-07-11T02:17:12.600627Z",
"iopub.status.busy": "2024-07-11T02:17:12.599890Z",
"iopub.status.idle": "2024-07-11T02:17:12.621489Z",
"shell.execute_reply": "2024-07-11T02:17:12.621025Z",
"shell.execute_reply.started": "2024-07-11T02:17:12.600557Z"
"iopub.execute_input": "2024-09-14T12:17:16.275045Z",
"iopub.status.busy": "2024-09-14T12:17:16.274382Z",
"iopub.status.idle": "2024-09-14T12:17:16.304051Z",
"shell.execute_reply": "2024-09-14T12:17:16.303490Z",
"shell.execute_reply.started": "2024-09-14T12:17:16.274984Z"
},
"tags": []
},
@@ -662,7 +662,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_天宫院社区2024.json'\n",
"filename = 'data/result_北体体质康健1.json'\n",
"with open(filename,'r') as fl:\n",
" dict2 = json.load(fl) \n",
"for k, v in dict2.items():\n",
@@ -683,7 +683,7 @@
" dict2[k][item_en]['score'] = cal_score(data1)\n",
" #print(k,v[item_en]['成绩'],cal_score(data1))\n",
"\n",
"filename = f'data/result_天宫院街道1.json'\n",
"filename = f'data/result_北体体质康健2.json'\n",
"with open(filename,'w') as fl:\n",
" json.dump(dict2,fl , ensure_ascii=False) \n",
"print('ok!') "
+17 -2
View File
@@ -18,12 +18,27 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"id": "bbba6efc-73cd-4db6-bae7-014724fee731",
"metadata": {
"execution": {
"iopub.execute_input": "2024-09-16T14:38:56.520481Z",
"iopub.status.busy": "2024-09-16T14:38:56.519690Z",
"iopub.status.idle": "2024-09-16T14:38:56.978133Z",
"shell.execute_reply": "2024-09-16T14:38:56.977605Z",
"shell.execute_reply.started": "2024-09-16T14:38:56.520410Z"
},
"tags": []
},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"ok\n"
]
}
],
"source": [
"import openpyxl\n",
"import json\n",
+1 -1
View File
@@ -461,7 +461,7 @@
### 寄棋客——郑谷
松窗楸局隐,相顾思皆凝,几局赌山果,一先饶海僧,覆图闻夜雨,下子对秋灯,何日无羁束,期君向杜陵。
### 观棋杜荀鹤
### 观棋——杜荀鹤
对面不相见,用心如用兵,算人常欲杀,顾己自贪生,得势侵吞远,乘危打劫赢,有时逢敌手,当局到深更。
### 棋——裴说
十九条平路,言平又崄巇,人心无算处,国手有输时,势逈流星远,声乾下雹迟,临轩才一局,寒日又西垂。
+162 -7
View File
@@ -174,16 +174,89 @@
" for item in list1:\n",
" dict1['img_'+str(item)] = InlineImage(tpl, image_descriptor=f'./img/{str(item)}.jpg',width=Mm(4))\n",
" tpl.render(dict1)\n",
" tpl.save(f'./docx/{p.stem}.docx')\n",
"#print(list1)\n",
"#doc.save('离垢居谈棋.docx')"
" tpl.save(f'./docx/{p.stem}.docx')\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"id": "ad5af12a-a322-4963-afc7-e3fdfbd9a4ab",
"metadata": {
"execution": {
"iopub.execute_input": "2024-08-29T10:02:06.727393Z",
"iopub.status.busy": "2024-08-29T10:02:06.726626Z",
"iopub.status.idle": "2024-08-29T10:02:06.755461Z",
"shell.execute_reply": "2024-08-29T10:02:06.754846Z",
"shell.execute_reply.started": "2024-08-29T10:02:06.727321Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"['10', '100', '101', '102', '103', '104', '105', '106', '107', '108', '109', '11', '110', '111', '112', '113', '114', '115', '116', '117', '118', '119', '12', '120', '121', '122', '123', '124', '125', '126', '127', '129', '13', '130', '131', '132', '133', '134', '135', '136', '137', '139', '14', '140', '141', '142', '143', '144', '145', '148', '149', '15', '150', '151', '152', '153', '154', '155', '156', '157', '159', '16', '160', '162', '163', '164', '165', '166', '169', '17', '170', '171', '172', '173', '174', '175', '176', '177', '178', '18', '180', '181', '182', '183', '184', '185', '186', '189', '19', '190', '191', '192', '194', '195', '196', '197', '198', '199', '2', '20', '200', '201', '202', '203', '204', '206', '208', '209', '21', '210', '211', '212', '213', '218', '219', '22', '220', '221', '23', '233', '237', '24', '240', '243', '25', '250', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '4', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '5', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '60', '61', '62', '63', '64', '65', '66', '67', '68', '69', '70', '71', '72', '73', '74', '75', '76', '77', '78', '79', '8', '80', '81', '82', '83', '86', '87', '88', '89', '90', '91', '92', '93', '94', '95', '96', '97', '98', '99']\n"
]
}
],
"source": [
"import glob\n",
"import os,shutil\n",
"from pathlib import Path\n",
"import re\n",
"from docx import Document\n",
"import openpyxl\n",
"from docxtpl import DocxTemplate,InlineImage\n",
"from docx.shared import Mm\n",
"\n",
"def find_all_numbers(text):\n",
" return re.findall(r'\\d+', text)\n",
"\n",
"def replace_numbers(text):\n",
" pattern = r'\\d+'\n",
" replacement = lambda x:'{{ '+ f'img_{x.group()}'+' }}'\n",
" modified_text = re.sub(pattern, replacement, text)\n",
" return modified_text\n",
"\n",
"def replace_numbers_with_braces(text):\n",
" # 使用正则表达式查找连续的数字\n",
" pattern = re.compile(r'\\d+')\n",
" \n",
" # 使用re.sub()进行替换\n",
" result = pattern.sub(lambda x: f\"{{{{ img_{x.group(0)} }}}}\", text)\n",
" \n",
" return result\n",
"fn = '文本文件/槐荫堂7.txt'\n",
"with open(fn, \"r\") as f:\n",
" list1 = []\n",
" \n",
" data = f.readlines()\n",
" for s in data:\n",
" list2 = []\n",
" ss = replace_numbers_with_braces(s)\n",
" list2 = find_all_numbers(s)\n",
" if len(list2)>0:\n",
" for item in list2:\n",
" list1.append(item)\n",
" \n",
" list1 = list(set(list1))\n",
" list1.sort()\n",
" \n",
" print(list1)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "8d3f1a7a-1322-48b5-9b14-c7ba8f38bacb",
"metadata": {
"execution": {
"iopub.execute_input": "2024-08-29T10:02:13.702443Z",
"iopub.status.busy": "2024-08-29T10:02:13.701668Z",
"iopub.status.idle": "2024-08-29T10:02:15.040667Z",
"shell.execute_reply": "2024-08-29T10:02:15.040126Z",
"shell.execute_reply.started": "2024-08-29T10:02:13.702372Z"
},
"tags": []
},
"outputs": [],
@@ -194,13 +267,13 @@
"\n",
"dict1 = {}\n",
"\n",
"tpl = DocxTemplate(\"离垢居谈棋.docx\")\n",
"tpl = DocxTemplate(\"templete/槐荫堂7.docx\")\n",
"for item in list1: \n",
" dict1['img_'+str(item)] = InlineImage(tpl, image_descriptor=f'./img/黑先/{str(item)}.jpg',width=Mm(4))\n",
"#dict1['img_radar'] = InlineImage(tpl, image_descriptor=dict1['radar'])\n",
"\n",
"tpl.render(dict1)\n",
"tpl.save('离垢居谈棋(黑先).docx')"
"tpl.save('./docx/槐荫堂7(黑先).docx')"
]
},
{
@@ -225,10 +298,92 @@
"tpl.save('离垢居谈棋(白先).docx')"
]
},
{
"cell_type": "markdown",
"id": "bd66efe6-1949-415c-aef3-7f953e1cf79f",
"metadata": {},
"source": [
"## Excel文件内容生成markdown格式文本"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "fcfd6cab-d83f-4b79-9a0b-05570ca6cecb",
"id": "117302bc-3b7f-4456-9770-d8da80594c4e",
"metadata": {},
"outputs": [],
"source": [
"import openpyxl\n",
"\n",
"fi_xls = 'data/对局目录.xlsx'\n",
"\n",
"wb = openpyxl.load_workbook(fi_xls)\n",
"sheet = wb['卷18'] \n",
"\n",
"\n",
"for n in range(sheet.max_row - 1,sheet.max_row+1): \n",
" print('## 第'+sheet.cell(n,1).value+'局 ')\n",
" print(sheet.cell(n,2).value+' ')\n",
" print(sheet.cell(n,3).value+' ')\n",
" print('共'+sheet.cell(n,4).value+'着 ')\n",
" if sheet.cell(n,5).value is not None:\n",
" print(sheet.cell(n,5).value+' ')\n",
" print(sheet.cell(n,6).value+' ')\n",
" print('\\n')"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "b3adea5a-d9da-45f8-be10-b0973acc7426",
"metadata": {
"execution": {
"iopub.execute_input": "2024-09-01T03:00:15.506058Z",
"iopub.status.busy": "2024-09-01T03:00:15.505309Z",
"iopub.status.idle": "2024-09-01T03:00:15.633772Z",
"shell.execute_reply": "2024-09-01T03:00:15.632885Z",
"shell.execute_reply.started": "2024-09-01T03:00:15.505989Z"
}
},
"outputs": [
{
"ename": "FileNotFoundError",
"evalue": "[Errno 2] No such file or directory: 'data/对局目录.xlsx'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mFileNotFoundError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[4], line 5\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mopenpyxl\u001b[39;00m\n\u001b[1;32m 3\u001b[0m fi_xls \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mdata/对局目录.xlsx\u001b[39m\u001b[38;5;124m'\u001b[39m\n\u001b[0;32m----> 5\u001b[0m wb \u001b[38;5;241m=\u001b[39m \u001b[43mopenpyxl\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mload_workbook\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfi_xls\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 6\u001b[0m sheet \u001b[38;5;241m=\u001b[39m wb[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m卷24\u001b[39m\u001b[38;5;124m'\u001b[39m] \n\u001b[1;32m 9\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m n \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mrange\u001b[39m(sheet\u001b[38;5;241m.\u001b[39mmax_row \u001b[38;5;241m-\u001b[39m \u001b[38;5;241m1\u001b[39m,\u001b[38;5;241m50\u001b[39m): \n",
"File \u001b[0;32m~/data/lib/python3.12/site-packages/openpyxl/reader/excel.py:344\u001b[0m, in \u001b[0;36mload_workbook\u001b[0;34m(filename, read_only, keep_vba, data_only, keep_links, rich_text)\u001b[0m\n\u001b[1;32m 314\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mload_workbook\u001b[39m(filename, read_only\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m, keep_vba\u001b[38;5;241m=\u001b[39mKEEP_VBA,\n\u001b[1;32m 315\u001b[0m data_only\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m, keep_links\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mTrue\u001b[39;00m, rich_text\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m):\n\u001b[1;32m 316\u001b[0m \u001b[38;5;250m \u001b[39m\u001b[38;5;124;03m\"\"\"Open the given filename and return the workbook\u001b[39;00m\n\u001b[1;32m 317\u001b[0m \n\u001b[1;32m 318\u001b[0m \u001b[38;5;124;03m :param filename: the path to open or a file-like object\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 342\u001b[0m \n\u001b[1;32m 343\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[0;32m--> 344\u001b[0m reader \u001b[38;5;241m=\u001b[39m \u001b[43mExcelReader\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfilename\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mread_only\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mkeep_vba\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 345\u001b[0m \u001b[43m \u001b[49m\u001b[43mdata_only\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mkeep_links\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mrich_text\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 346\u001b[0m reader\u001b[38;5;241m.\u001b[39mread()\n\u001b[1;32m 347\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m reader\u001b[38;5;241m.\u001b[39mwb\n",
"File \u001b[0;32m~/data/lib/python3.12/site-packages/openpyxl/reader/excel.py:123\u001b[0m, in \u001b[0;36mExcelReader.__init__\u001b[0;34m(self, fn, read_only, keep_vba, data_only, keep_links, rich_text)\u001b[0m\n\u001b[1;32m 121\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m__init__\u001b[39m(\u001b[38;5;28mself\u001b[39m, fn, read_only\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m, keep_vba\u001b[38;5;241m=\u001b[39mKEEP_VBA,\n\u001b[1;32m 122\u001b[0m data_only\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m, keep_links\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mTrue\u001b[39;00m, rich_text\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m):\n\u001b[0;32m--> 123\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39marchive \u001b[38;5;241m=\u001b[39m \u001b[43m_validate_archive\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfn\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 124\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mvalid_files \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39marchive\u001b[38;5;241m.\u001b[39mnamelist()\n\u001b[1;32m 125\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mread_only \u001b[38;5;241m=\u001b[39m read_only\n",
"File \u001b[0;32m~/data/lib/python3.12/site-packages/openpyxl/reader/excel.py:95\u001b[0m, in \u001b[0;36m_validate_archive\u001b[0;34m(filename)\u001b[0m\n\u001b[1;32m 88\u001b[0m msg \u001b[38;5;241m=\u001b[39m (\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mopenpyxl does not support \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m file format, \u001b[39m\u001b[38;5;124m'\u001b[39m\n\u001b[1;32m 89\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mplease check you can open \u001b[39m\u001b[38;5;124m'\u001b[39m\n\u001b[1;32m 90\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mit with Excel first. \u001b[39m\u001b[38;5;124m'\u001b[39m\n\u001b[1;32m 91\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mSupported formats are: \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m'\u001b[39m) \u001b[38;5;241m%\u001b[39m (file_format,\n\u001b[1;32m 92\u001b[0m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m,\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;241m.\u001b[39mjoin(SUPPORTED_FORMATS))\n\u001b[1;32m 93\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m InvalidFileException(msg)\n\u001b[0;32m---> 95\u001b[0m archive \u001b[38;5;241m=\u001b[39m \u001b[43mZipFile\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfilename\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mr\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[1;32m 96\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m archive\n",
"File \u001b[0;32m/usr/lib/python3.12/zipfile/__init__.py:1331\u001b[0m, in \u001b[0;36mZipFile.__init__\u001b[0;34m(self, file, mode, compression, allowZip64, compresslevel, strict_timestamps, metadata_encoding)\u001b[0m\n\u001b[1;32m 1329\u001b[0m \u001b[38;5;28;01mwhile\u001b[39;00m \u001b[38;5;28;01mTrue\u001b[39;00m:\n\u001b[1;32m 1330\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m-> 1331\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mfp \u001b[38;5;241m=\u001b[39m \u001b[43mio\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mopen\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfile\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mfilemode\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1332\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mOSError\u001b[39;00m:\n\u001b[1;32m 1333\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m filemode \u001b[38;5;129;01min\u001b[39;00m modeDict:\n",
"\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: 'data/对局目录.xlsx'"
]
}
],
"source": [
"import openpyxl\n",
"\n",
"fi_xls = 'data/对局目录.xlsx'\n",
"\n",
"wb = openpyxl.load_workbook(fi_xls)\n",
"sheet = wb['卷24'] \n",
"\n",
"\n",
"for n in range(sheet.max_row - 1,50): \n",
" print(sheet.cell(n,1).value+' ')\n",
" print(sheet.cell(n,2).value+' ')\n",
" print(sheet.cell(n,3).value+' ')\n",
" print(sheet.cell(n,4).value+' ')\n",
" \n",
" print('\\n')"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ce35a953-51bc-450b-8af6-9f68edc2f9b1",
"metadata": {},
"outputs": [],
"source": []
@@ -1950,7 +1950,9 @@
{
"cell_type": "markdown",
"id": "c2e96af6-ede4-4dd8-8b94-349e29838dda",
"metadata": {},
"metadata": {
"jp-MarkdownHeadingCollapsed": true
},
"source": [
"# 槐荫堂钞存围棋谱 卷伍"
]
@@ -2409,7 +2411,7 @@
"## 第二十五局\n",
"徐星友 \n",
"何暗公 胜 \n",
"共二百四十一着 \n",
"共一百四十一着 \n",
"对子 \n",
"寄闲斋 \n",
"\n"
@@ -2589,7 +2591,7 @@
"source": [
"## 第三十六局\n",
"张次云 \n",
"徐星友 \n",
"徐星友 胜 \n",
"共二百四十二着 \n",
"对子 \n",
"鸿雪轩钞谱 \n",
@@ -2926,12 +2928,12 @@
"metadata": {},
"source": [
"## 第五十三局\n",
"范紫纶 \n",
"范紫纶 白胜 \n",
"金廷三 \n",
"共二百二十八着 \n",
"受先 \n",
"师竹斋饶子谱 \n",
"\n"
"(注:本局为黑先白后)\n"
]
},
{
@@ -2945,7 +2947,7 @@
"共二百二十八着 \n",
"受先 \n",
"师竹斋饶子谱 \n",
"\n"
"(注:本局为黑先白后)\n"
]
},
{
@@ -2972,7 +2974,7 @@
"俞永嘉 黑胜 \n",
"共一百八十五着 \n",
"对子 \n",
"围棋近谱 \n",
"饶子谱 \n",
"\n"
]
},
@@ -3368,14 +3370,16 @@
"对子 \n",
"晚香亭弈谱 \n",
"\n",
"15关胜尖。19当220位长,黑八五路关,白五九路关起为正。26至39不易。42当于207位投,白如65位关,黑亦关出;白如于131位盖,黑120位挖,皆可分出。43当229位飞,虚灵。50多事,当224位扳,得先手好。55当先接后尖。58仍当封头。63老成。65必争之着。66躁急,当110位飞,以图变化。67至77是。78当粘。79当先于87位打,黑长,再于80位托;黑如84位扳,白180位平,黑179位盖,白85位扳,黑82位立,白九四路打,黑惟有92位打,白断,黑提,白粘,黑83位扳下,打劫本身劫多,黑不能胜;如白85位扳,黑于79位打,白吃,黑82位打,白提,黑粘,白于89位飞,边子既活,复成两走;设黑不于84位扳,于179位退,白180位挤,黑82位立,白九四路扳,黑仍不敢粘。今分两地经营,吃亏殆尽。94、96次序井然。102力量,胸有成竹。103点,入其彀中。108随手。109至119大得便宜。129不若竟吃二子好。138虎过无变。139细。201缓,乃白固有之着,当221位吃一子。209挡210位吃。 \n",
"15关胜尖。19当220位长,黑八五路关,白五九路关起为正。26至39不易。42当于207位投,白如65位关,黑亦关出;白如于131位盖,黑120位挖,皆可分出。43当229位飞,虚灵。50多事,当224位扳,得先手好。55当先接后尖。58仍当封头。63老成。65必争之着。66躁急,当110位飞,以图变化。67至77是。78当粘。79当先于87位打,黑长,再于80位托;黑如84位扳,白180位平,黑179位盖,白85位扳,黑82位立,白九四路打,黑惟有92位打,白断,黑提,白粘,黑83位扳下,打劫本身劫多,黑不能胜;如白85位扳,黑于79位打,白吃,黑82位打,白提,黑粘,白于89位飞,边子既活,复成两走;设黑不于84位扳,于179位退,白180位挤,黑82位立,白九四路扳,黑仍不敢粘。今分两地经营,吃亏殆尽。94、96次序井然。102力量,胸有成竹。103点,入其彀中。108随手,109至119大得便宜。129不若竟吃二子好。138虎过无变。139细。201缓,乃白固有之着,当221位吃一子。209当210位吃。 \n",
"程兰如评。"
]
},
{
"cell_type": "markdown",
"id": "2a7e848d-c1f2-4b20-8e33-90eb45d66cc0",
"metadata": {},
"metadata": {
"jp-MarkdownHeadingCollapsed": true
},
"source": [
"# 槐荫堂钞存围棋谱 卷陆"
]
@@ -3397,7 +3401,7 @@
"## 第二局 \n",
"梁魏今 胜 \n",
"冒湘舟 \n",
"共一百十二着 \n",
"共二百九十着 \n",
"对子 \n",
"鸿雪轩钞谱 \n",
"\n",
@@ -3654,7 +3658,7 @@
"\n",
"## 第十六局 \n",
"江天远 \n",
"梁魏今 \n",
"梁魏今 胜 \n",
"共二百四十六着 \n",
"对子 \n",
"国弈初刊 \n",
@@ -3702,7 +3706,7 @@
"## 第二十一局 \n",
"赵两峰 \n",
"梁魏今 \n",
"共一百九十二六着 \n",
"共一百九十二着 \n",
"对子 \n",
"国弈初刊 \n",
"\n",
@@ -3720,7 +3724,7 @@
"## 第二十三局 \n",
"梁魏今 胜三子半 \n",
"赵两峰 \n",
"共一百五十着 \n",
"共二百五十三着 \n",
"对子 \n",
"国弈初刊 \n",
"\n",
@@ -3765,7 +3769,7 @@
"## 第二十八局 \n",
"梁魏今 \n",
"赵两峰 胜 \n",
"共二百二十四着 \n",
"共二百七十九着 \n",
"对子 \n",
"国弈初刊 \n",
"\n",
@@ -3774,7 +3778,7 @@
"## 第二十九局 \n",
"赵两峰 \n",
"梁魏今 胜四子半 \n",
"共二百十五着 \n",
"共二百四十着 \n",
"对子 \n",
"国弈初刊 \n",
"\n",
@@ -4050,7 +4054,7 @@
"## 第四十一局 \n",
"程兰如 胜三子半 \n",
"赵两峰 \n",
"共二百四十五着 \n",
"共二百五十三着 \n",
"对子 \n",
"弈程 \n",
"\n",
@@ -4121,8 +4125,8 @@
"\n",
"\n",
"## 第四十三局 \n",
"赵两峰 胜 \n",
"程兰如 \n",
"赵两峰 \n",
"程兰如 胜四子半 \n",
"共二百五十二着 \n",
"对子 \n",
"怡怡堂谱\n",
@@ -4178,7 +4182,7 @@
"## 第四十五局 \n",
"程兰如 \n",
"赵两峰 \n",
"共二百二十三着 \n",
"共一百八十一着 \n",
"对子 \n",
"国弈初刊\n",
"\n",
@@ -4302,7 +4306,9 @@
{
"cell_type": "markdown",
"id": "693dfb51-005e-4180-8480-dbad8a808fa0",
"metadata": {},
"metadata": {
"jp-MarkdownHeadingCollapsed": true
},
"source": [
"# 槐荫堂钞存围棋谱 卷柒"
]
@@ -5003,7 +5009,9 @@
{
"cell_type": "markdown",
"id": "97749f41-4e85-4515-ad68-4305fe1be6a8",
"metadata": {},
"metadata": {
"jp-MarkdownHeadingCollapsed": true
},
"source": [
"# 槐荫堂钞存围棋谱 卷捌"
]
@@ -5568,8 +5576,8 @@
"\n",
"\n",
"## 第四十四局 \n",
"程兰如 \n",
"施襄夏 \n",
"程兰如 胜 \n",
"共一百七十着 \n",
"对子 \n",
"弈妙 \n",
@@ -5591,7 +5599,7 @@
"\n",
"## 第四十六局 \n",
"梁魏今 \n",
"范西屏 \n",
"范西屏 胜 \n",
"共一百六十二着 \n",
"对子 \n",
"围棋近谱 \n",
@@ -5602,7 +5610,7 @@
"## 第四十七局 \n",
"梁魏今 胜 \n",
"范西屏 \n",
"共一百六十二着 \n",
"共一百九十九着 \n",
"对子 \n",
"弈妙 \n",
"\n",
@@ -5835,9 +5843,7 @@
{
"cell_type": "markdown",
"id": "e24d6bc8-1a47-4d83-a5c8-4ced2a35c378",
"metadata": {
"jp-MarkdownHeadingCollapsed": true
},
"metadata": {},
"source": [
"# 槐荫堂钞存围棋谱 卷玖"
]
@@ -6306,8 +6312,8 @@
"\n",
"\n",
"## 第二十七局 \n",
"申立功 \n",
"潘景斋 胜 \n",
"申立功 胜 \n",
"潘景斋 \n",
"共二百四十一着 \n",
"对子 \n",
"潘景斋弈谱 \n",
@@ -6633,15 +6639,6 @@
"对子 \n",
"皖游弈萃 \n",
"\n",
"\n",
"\n",
"## 第四十一局 \n",
"德卉亭 \n",
"僧秋航 \n",
"共二百六十四着 \n",
"对子 \n",
"烂柯仙馆弈钞 \n",
"\n",
"10不宜尖应,当115位压。\n",
"11宜84位拆三,先整大局。\n",
"12习气,当21位投。\n",
@@ -6664,6 +6661,13 @@
"117欠细,既知有129一断之巧,当先于140吃,再于117位征,使黑无变。今不打即征,黑130若于141吃,转换恐不便宜。\n",
"此局黑白失着如此之多,本不当录,因秋公、介之仅此一局,故存之以见一斑。\n",
"\n",
"## 第四十一局 \n",
"德卉亭 \n",
"僧秋航 \n",
"共二百六十四着 \n",
"对子 \n",
"烂柯仙馆弈钞 \n",
"\n",
"\n",
"## 第四十二局 \n",
"德卉亭 \n",
@@ -6679,8 +6683,8 @@
"董鹿泉 \n",
"共一百八十七着 \n",
"对子 \n",
"如松堂谱 \n",
"\n",
"怡怡堂谱 \n",
"尊天爵斋弈録作周小松、董鹿泉\n",
"\n",
"\n",
"## 第四十四局 \n",
@@ -7559,6 +7563,7 @@
"对子 \n",
"待月𣘵弈存 \n",
"\n",
"右方、周对垒一局,非必其本家笔也,特原局主名已不可考,姑因所题题之。\n",
"\n",
"\n",
"## 第五十二局 \n",
@@ -7643,7 +7648,7 @@
"对子 \n",
"皖游弈萃 \n",
"\n",
"起手之27局面皆正。\n",
"起手至27局面皆正。\n",
"28是。\n",
"30即当32位关。\n",
"31亦宜32位关。\n",
@@ -8269,7 +8274,7 @@
"\n",
"\n",
"## 第五十七局 \n",
"金平垒 \n",
"金平垒 白先 \n",
"汪叙诗 \n",
"共二百零一着 \n",
"对子 \n",
@@ -8311,7 +8316,8 @@
"对子 \n",
"汪叙诗弈谱 \n",
"\n",
"\n",
"叙诗与余同里,其先服贾汉上,丱角时即工弈,尝受子于耀文。此数局乃将成二子时所作,姑英气勃发,极淋漓磅礴之至。\n",
"小舟\n",
"\n",
"## 第六十二局 \n",
"何见周 \n",
@@ -8442,7 +8448,7 @@
"## 第八局 \n",
"黄龙士 \n",
"苏揆之 \n",
"共二百八十八着 \n",
"共一百八十八着 \n",
"受二子 \n",
"怡怡堂谱 \n",
"\n",
@@ -8471,7 +8477,7 @@
"苏揆之 \n",
"共二百五十七着 \n",
"受二子 \n",
"怡怡堂谱 \n",
"围棋近谱 \n",
"\n",
"\n",
"\n",
@@ -8480,7 +8486,7 @@
"吴来仪 \n",
"共二百二十二着 \n",
"受二子 \n",
"弈彙 \n",
"弈汇 \n",
"\n",
"\n",
"\n",
@@ -8979,7 +8985,7 @@
"\n",
"\n",
"## 第五十三局 \n",
"梁会京 \n",
"梁会京 胜 \n",
"童和衷 \n",
"共二百八十六着 \n",
"受二子 \n",
@@ -9064,6 +9070,8 @@
"受二子 \n",
"弈彙 \n",
"\n",
"卷首评:孙怡堂云:78当一二路立,今按136断,借以生波,137不应长,宜142位反打,以后138虎出,白虽得角,外势尽伤,皆此一着之误。\n",
"\n",
"14当上角三七路飞。\n",
"16当20位压,凡遇双飞,角左右有拆三、拆四者,不可盖压,实边压拆二者,拆二已实,何妨再实。\n",
"31当33位长。\n",
@@ -3,7 +3,9 @@
{
"cell_type": "markdown",
"id": "be3571d5-60ff-43de-833a-21bb1fdc4b26",
"metadata": {},
"metadata": {
"jp-MarkdownHeadingCollapsed": true
},
"source": [
"# 槐荫堂钞存围棋谱 卷拾叁"
]
@@ -689,15 +691,6 @@
"受二子 \n",
"受子谱 \n",
"\n",
"\n",
"\n",
"## 第六十一局 \n",
"范西屏 \n",
"胡肇麟 \n",
"共二百三十三着 \n",
"受二子 \n",
"受子谱 \n",
"\n",
"5大飞,亦可着。\n",
"10当11位投,如受四、五子者,大飞加拆二原可强边固角,若受二、三子者,则犯重叠之弊矣。\n",
"14当时要着。\n",
@@ -725,6 +718,16 @@
"220草率,221若在四九路接,便可吃黑矣。 \n",
"弈汇评\n",
"\n",
"\n",
"## 第六十一局 \n",
"范西屏 \n",
"胡肇麟 \n",
"共二百三十三着 \n",
"受二子 \n",
"受子谱 \n",
"\n",
"\n",
"\n",
"## 第六十二局 \n",
"范西屏 \n",
"胡肇麟 \n",
@@ -772,6 +775,8 @@
"受二子 \n",
"围棋受子谱 \n",
"\n",
"203宜204扳出。\n",
"\n",
"\n",
"## 第三局 \n",
"施定庵 \n",
@@ -1072,7 +1077,7 @@
"\n",
"\n",
"## 第二十六局 \n",
"范西屏 \n",
"范西屏 胜 \n",
"童和衷 \n",
"共二百十九着 \n",
"受二子 \n",
@@ -1632,7 +1637,7 @@
"\n",
"## 第三十六局 \n",
"潘景斋 胜 \n",
"王㻙琪 \n",
"陈㻙琪 \n",
"共二百三十七着 \n",
"受二子 \n",
"潘景斋弈谱 \n",
@@ -1675,7 +1680,7 @@
"\n",
"## 第三十七局 \n",
"潘景斋 \n",
"王㻙琪 胜 \n",
"陈㻙琪 胜 \n",
"共二百二十一着 \n",
"受二子 \n",
"潘景斋弈谱 \n",
@@ -1708,7 +1713,7 @@
"\n",
"## 第三十八局 \n",
"潘景斋 胜 \n",
"王㻙琪 \n",
"陈㻙琪 \n",
"共二百十九着 \n",
"受二子 \n",
"潘景斋弈谱 \n",
@@ -1740,7 +1745,7 @@
"\n",
"## 第三十九局 \n",
"潘景斋 \n",
"王㻙琪 胜 \n",
"陈㻙琪 胜 \n",
"共二百四十五着 \n",
"受二子 \n",
"潘景斋弈谱 \n",
@@ -2117,9 +2122,7 @@
{
"cell_type": "markdown",
"id": "c61f5d18-39a0-44fe-8ca6-0ec17a6b54ee",
"metadata": {
"jp-MarkdownHeadingCollapsed": true
},
"metadata": {},
"source": [
"# 槐荫堂钞存围棋谱 卷拾陆"
]
@@ -2432,6 +2435,8 @@
"受二子 \n",
"烂柯仙馆弈钞 \n",
"\n",
"丁亥六月廿六弈于薛抚屏中丞寓斋\n",
"\n",
"\n",
"## 第三十九局 \n",
"周小松 \n",
@@ -2488,6 +2493,8 @@
"受二子 \n",
"烂柯仙馆弈钞 \n",
"\n",
"光绪十三年丁亥七月初九日弈于肃邸。\n",
"\n",
"\n",
"## 第四十六局 \n",
"周小松 \n",
@@ -3392,9 +3399,7 @@
{
"cell_type": "markdown",
"id": "c41f1f89-f668-4c24-8965-cb1ff41544ad",
"metadata": {
"jp-MarkdownHeadingCollapsed": true
},
"metadata": {},
"source": [
"# 槐荫堂钞存围棋谱 卷拾捌"
]
@@ -3478,7 +3483,7 @@
"\n",
"## 第十局 \n",
"潘星见 \n",
"房俊臣 \n",
"方俊臣 \n",
"共一百十一着 \n",
"受三子 \n",
"弈汇 \n",
@@ -3519,7 +3524,7 @@
"## 第十五局 \n",
"潘星见 \n",
"袁岭崇 \n",
"共一百三十八着 \n",
"共二百三十八着 \n",
"受三子 \n",
"弈汇 \n",
"\n",
@@ -3737,6 +3742,10 @@
"受三子 \n",
"围棋新谱\n",
"\n",
"勤垣为鄂藩书吏,棋思最缓一日夜方终一局。小松虽授以三子,然尚未能工力悉敌也。\n",
"小舟。\n",
"\n",
"\n",
"\n",
"## 第三十一局 \n",
"周小松 \n",
@@ -3813,7 +3822,7 @@
"## 第四十局 \n",
"周小松 \n",
"丁剑侯 \n",
"共二百八十七着 \n",
"共一百八十七着 \n",
"受三子 \n",
"皖游弈萃 \n",
"\n",
@@ -3974,9 +3983,7 @@
{
"cell_type": "markdown",
"id": "5910c312-eebc-433c-bc5c-ba23ad2e0209",
"metadata": {
"jp-MarkdownHeadingCollapsed": true
},
"metadata": {},
"source": [
"# 槐荫堂钞存围棋谱 卷拾玖"
]
@@ -4055,7 +4062,7 @@
"曹禹玉 \n",
"共一百八十三着 \n",
"受四子 \n",
"受子谱 \n",
"怡怡堂谱 \n",
"\n",
"\n",
"## 第十局 \n",
@@ -4367,6 +4374,8 @@
"受四子 \n",
"怡怡堂谱 \n",
"\n",
"此局本系二百六十五着,因原本谬误颇多,无从校正,故止录及此。\n",
"\n",
"\n",
"## 第四十五局 \n",
"施襄夏 \n",
@@ -4386,7 +4395,7 @@
"\n",
"## 第四十七局 \n",
"施襄夏 \n",
"胡位三 \n",
"胡位三 黑胜\n",
"共二百零一着 \n",
"受四子 \n",
"饶子谱 \n",
@@ -4499,7 +4508,7 @@
"## 第六十一局 \n",
"李松石 \n",
"程序东 \n",
"共一百五十九着 \n",
"共一百五十七着 \n",
"受四子 \n",
"受子谱 \n",
"\n",
@@ -4570,7 +4579,7 @@
"\n",
"## 第六十六局 \n",
"潘景斋 胜 \n",
"刘克用 \n",
"刘克有 \n",
"共一百六十五着 \n",
"受四子 \n",
"潘景斋弈谱 \n",
@@ -4601,7 +4610,7 @@
"\n",
"## 第六十七局 \n",
"潘景斋 \n",
"僧广智 \n",
"僧广智 胜 \n",
"共二百零八着 \n",
"受四子 \n",
"潘景斋弈谱 \n",
@@ -4952,7 +4961,7 @@
"## 第十五局 \n",
"陈子仙 \n",
"赵晋卿 \n",
"共一百八十三着 \n",
"共一百八十五着 \n",
"受四子 \n",
"陈子仙弈谱 \n",
"\n",
@@ -5039,7 +5048,7 @@
"\n",
"## 第二十六局 \n",
"徐星友 \n",
"覃夔士 \n",
"谭夔士 \n",
"共一百八十七着 \n",
"受五子 \n",
"受子谱 \n",
@@ -5124,6 +5133,8 @@
"受五子 \n",
"饶子谱 \n",
"\n",
"是局本二百二十九着,因二百三以下有脱误,故止录及此。\n",
"\n",
"\n",
"## 第三十七局 \n",
"梁魏今 大胜 \n",
@@ -5439,7 +5450,7 @@
"虞象明 \n",
"共一百二十二着 \n",
"受五子 \n",
"镜子谱 \n",
"饶子谱 \n",
"\n",
"\n",
"## 第十四局 \n",
@@ -5660,7 +5671,7 @@
"\n",
"## 第四十一局 \n",
"李湛源 \n",
"王桂庵 \n",
"汪桂庵 \n",
"共二百四十三着 \n",
"受六子 \n",
"怡怡堂谱 \n",
@@ -5670,7 +5681,7 @@
"娄子恩 \n",
"赵端木 \n",
"共一百九十八着 \n",
"受六子 \n",
"受七子 \n",
"怡怡堂谱 \n",
"\n",
"\n",
@@ -5906,8 +5917,9 @@
"对子 \n",
"弈括 \n",
"\n",
"此局于《拟子谱》第十一俱相复,惟《拟子谱》攻171着,此局只153着。二谱皆出于龙士之手,未知孰为先后,故并存之。 \n",
"南封谭其文识\n",
"此局于《拟子谱》第十一俱相复,惟《拟子谱》共百七十一,此局只百五十三着。二谱皆出于龙士之手,未知孰为先后,故并存之。 \n",
"南丰谭其文识\n",
"\n",
"\n",
"## 第十四局 \n",
"第十四局 \n",
@@ -6567,6 +6579,8 @@
"对子 \n",
"棋经连珠 \n",
"\n",
"右《日本弈谱》刻于文化五年,即国超嘉庆之十三年也。款为元美先生著,共四卷,约百许局,兹选录廿四局,盖以备一格云。 \n",
"\n",
"\n",
"## 第二局 \n",
"道硕 \n",
@@ -6591,21 +6605,21 @@
"\n",
"## 第五局 \n",
"算智 \n",
"因策 \n",
"因策 先\n",
"共百六十六着 \n",
"棋经连珠 \n",
"\n",
"\n",
"## 第六局 \n",
"算智 \n",
"哲斋 \n",
"哲斋 先 \n",
"共百三十三着 \n",
"棋经连珠 \n",
"\n",
"\n",
"## 第七局 \n",
"算智 \n",
"哲斋 \n",
"哲斋 先 \n",
"共百卅九着 \n",
"棋经连珠 \n",
"\n",
@@ -6626,7 +6640,7 @@
"\n",
"## 第十局 \n",
"道悦 \n",
"山甲 \n",
"山家 先 \n",
"共百九十七着 \n",
"棋经连珠 \n",
"\n",
@@ -6736,6 +6750,9 @@
"对局 \n",
"东洋棋谱 \n",
"\n",
"右《东洋棋谱》壹卷,共六十五局,碁院(注:应为现在的“棋所”)丈和所著,序为文政八年,即国朝道光五年也。光绪丁酉于友人冯庚虞处见有钞本,因摘录十二局。\n",
"琴城谭其文识。 \n",
"\n",
"\n",
"## 第二十六局 \n",
"安节 \n",
@@ -6778,8 +6795,8 @@
"\n",
"\n",
"## 第三十一局 \n",
"智策 \n",
"丈和 \n",
"智策 \n",
"共九十一着 \n",
"对局 \n",
"东洋棋谱 \n",
@@ -6832,6 +6849,9 @@
"对子 \n",
"中山弈谱 \n",
"\n",
"右《中山弈谱》十二局,琉球国弈孙小文辑著,同治己巳荫庭吴氏刻于闽中者也。录存以备一格。\n",
"琴城谭其文识。 \n",
"\n",
"\n",
"## 第三十八局 \n",
"津波 \n",
+318 -74
View File
@@ -245,28 +245,9 @@
},
{
"cell_type": "code",
"execution_count": 36,
"metadata": {
"execution": {
"iopub.execute_input": "2024-06-29T15:48:22.519722Z",
"iopub.status.busy": "2024-06-29T15:48:22.518971Z",
"iopub.status.idle": "2024-06-29T15:48:22.528988Z",
"shell.execute_reply": "2024-06-29T15:48:22.527881Z",
"shell.execute_reply.started": "2024-06-29T15:48:22.519655Z"
}
},
"outputs": [
{
"data": {
"text/plain": [
"'此亦宝力菱成上所不可缺者兹举其基本变化十'"
]
},
"execution_count": 36,
"execution_count": null,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"from opencc import OpenCC\n",
"\n",
@@ -449,40 +430,9 @@
},
{
"cell_type": "code",
"execution_count": 34,
"metadata": {
"execution": {
"iopub.execute_input": "2024-06-26T06:43:44.557080Z",
"iopub.status.busy": "2024-06-26T06:43:44.556349Z",
"iopub.status.idle": "2024-06-26T06:43:44.660660Z",
"shell.execute_reply": "2024-06-26T06:43:44.660091Z",
"shell.execute_reply.started": "2024-06-26T06:43:44.557015Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"## 第五十八局 \n",
"陈子仙 \n",
"汪叙诗 \n",
"共二百二十一着 \n",
"受三子 \n",
"汪叙诗弈谱 \n",
"\n",
"\n",
"## 第五十九局 \n",
"陈子仙 \n",
"汪叙诗 \n",
"共百九十二着 \n",
"受三子 \n",
"汪叙诗弈谱 \n",
"\n",
"\n"
]
}
],
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import openpyxl\n",
"\n",
@@ -503,6 +453,29 @@
" print('\\n')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import openpyxl\n",
"\n",
"fi_xls = 'data/对局目录.xlsx'\n",
"\n",
"wb = openpyxl.load_workbook(fi_xls)\n",
"sheet = wb['卷24'] \n",
"\n",
"\n",
"for n in range(50,562): \n",
" print(sheet.cell(n,1).value+' ')\n",
" if sheet.cell(n,2).value is not None:\n",
" print(sheet.cell(n,2).value+' ')\n",
" if sheet.cell(n,3).value is not None:\n",
" print(sheet.cell(n,3).value+' ')\n",
" print('\\n')"
]
},
{
"cell_type": "code",
"execution_count": null,
@@ -526,6 +499,293 @@
" print('\\n')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import openpyxl\n",
"\n",
"fi_xls = 'data/对局目录.xlsx'\n",
"\n",
"wb = openpyxl.load_workbook(fi_xls)\n",
"sheet = wb['卷24'] \n",
"\n",
"\n",
"for n in range(50,562): \n",
" #print(sheet.cell(n,1).value+' ')\n",
" if sheet.cell(n,2).value is not None:\n",
" print(sheet.cell(n,1).value+' '+sheet.cell(n,2).value+' '+sheet.cell(n,3).value+'局')\n",
" else:\n",
" print(sheet.cell(n,1).value+' ')\n",
" \n",
" "
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
"execution": {
"iopub.execute_input": "2024-09-01T03:46:45.192219Z",
"iopub.status.busy": "2024-09-01T03:46:45.191408Z",
"iopub.status.idle": "2024-09-01T03:46:45.305652Z",
"shell.execute_reply": "2024-09-01T03:46:45.305039Z",
"shell.execute_reply.started": "2024-09-01T03:46:45.192134Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"苏揆之 \n",
"邵文远 \n",
"朱缵公 \n",
"范胜林 \n",
"邱商贤 \n",
"胡肇麟 盐商,性酷嗜弈,有胡铁头之称。\n",
"僧贯如 著有《贯如弈谱》\n",
"金仲柳 \n",
"姜杰士 \n",
"金廷三 \n",
"金玠文 \n",
"赖乔山 \n",
"沈衡之 \n",
"李锦文 \n",
"臧念宣 著有《弈理析疑》行世。\n",
"陈苑游 \n",
"吴凤来 \n",
"韩学元 \n",
"黄及侣 \n",
"俞永嘉 字长候,湘人。弈品第三,为范西屏之师,施襄夏幼时亦当师之。\n",
"童和衷 \n",
"张丹九 著有《三张弈谱》。\n",
"郭璜友 \n",
"陈九如 \n",
"洪羽翔 \n",
"吴莼圃 \n",
"罗允升 \n",
"卞子兰 \n",
"江星若 \n",
"朱天植 \n",
"郑涟漪 \n",
"李步青 吴修圃云:忆三十年前,步青遇西屏于金陵,受二子共六局,胜负参半。越二年,步青复于吴越对弈四局,受先亦互有胜负,近年所诣益,未知视西屏奚若矣。\n",
"周春来 \n",
"何右林 名耕书,为范西屏高足弟子。\n",
"吴冠三 \n",
"金在田 \n",
"谭揆士 \n",
"钮亮周 \n",
"郭溶川 \n",
"洪羽翔 (注:重复)\n",
"范紫纶 \n",
"卜沧如 \n",
"姚聘三 \n",
"顾审音 \n",
"黄友功 \n",
"张廷彦 \n",
"胡敬孚 疑即胡肇麟\n",
"黄掌纶 \n",
"陈㻙琪 \n",
"沈重伦 \n",
"祥成 \n",
"格臈林阿 \n",
"方俊臣 \n",
"王小兰 \n",
"陈德崇 \n",
"僧慢得 辑有《空中楼阁弈谱》。\n",
"袁岭崇 \n",
"陈复初 \n",
"永治庵 \n",
"德乐庵 \n",
"于清和 \n",
"王公锡 \n",
"吴是中 \n",
"郑液池 \n",
"徐履中 \n",
"何朂庵 \n",
"陈炳麟 \n",
"张景福 \n",
"纪懋斋 \n",
"章芝楣 与楚桐隐合评《潘景斋弈谱约选》。\n",
"关介田 \n",
"严德音 \n",
"朱锦川 \n",
"陈天汉 \n",
"高九锡 \n",
"温佩良 粤东人,辑有《弈彙》上下册。\n",
"徐艺斋 \n",
"刘勤垣 \n",
"丁礼民 \n",
"史莲叔 \n",
"何见周 \n",
"徐鹤年 \n",
"孙春沂 \n",
"方荫臣 \n",
"戴星门 \n",
"郭云海 \n",
"丁剑侯 \n",
"方秋客 \n",
"刘春圃 \n",
"何不药 \n",
"曹丽塘 \n",
"潘秀甫 \n",
"钱芳圃 著有《钱芳圃弈谱》。\n",
"刘叔伦 名绪,江西南丰人,咸丰庚申进士,刑部郎中,官至大理寺少卿,寿八十有奇,著有《如松堂弈谱》一卷。\n",
"松茂亭 名桂,满洲人。\n",
"刘云峰 直隶人,居京师。\n",
"汪叙诗 安徽歙县人。著有《汪叙诗弈谱》。\n",
"诸弈者姓名 同前,以时代为次\n",
"王性有 \n",
"嵇修五 \n",
"叶岐山 \n",
"江溯岷 \n",
"孙茂臣 \n",
"黄隐求 \n",
"虞象明 \n",
"林葛陂 \n",
"凌葛坡 疑即林葛陂之误。\n",
"尤子成 \n",
"曹禹玉 \n",
"高景于 \n",
"程九仪 \n",
"马又白 \n",
"陆韶九 \n",
"沈子尚 \n",
"高峻宇 疑即高景于之误。\n",
"王六吉 \n",
"徐景周 \n",
"李梅崖 \n",
"王季修 \n",
"张履贞 \n",
"张兼善 \n",
"吴佩六 \n",
"程鸿儒 \n",
"杨景先 \n",
"周芳政 \n",
"赵端木 \n",
"邵次珩 \n",
"顾廷光 \n",
"周东艺 \n",
"吴虞臣 \n",
"邵含章 \n",
"程乐田 \n",
"李景文 \n",
"刘继武 \n",
"张公书 \n",
"钱东汇 著有《残局类选》。\n",
"陈耆年 \n",
"邵翼圣 \n",
"倪克让 \n",
"段朗卿 \n",
"李义宾 \n",
"黄友南 \n",
"郭虹如 \n",
"韩柱臣 \n",
"汪掌纶 \n",
"卞立言 著有《弈萃官子》二卷。\n",
"黄经文 \n",
"萧洛理 \n",
"胡位三 \n",
"张振西 \n",
"陈洪 \n",
"石某 \n",
"周果亭 \n",
"王月山 \n",
"宋鸣歧 \n",
"陈廷桂 \n",
"马立亭 \n",
"王莘臣 \n",
"云脉 \n",
"陆士经 \n",
"刘宽夫 \n",
"达顺成 \n",
"陈冶夫 \n",
"王晋风 \n",
"萧菊如 \n",
"许蔬庵 \n",
"巴德符 \n",
"唐蟾之 一作蝉枝。\n",
"党苍云 \n",
"王廷璧 \n",
"方作周 \n",
"程序东 \n",
"刘馨斋 \n",
"刘克有 \n",
"僧广智 \n",
"严弈山 \n",
"杨介亭 \n",
"宋致堂 \n",
"善庆斋 \n",
"傅崧泉 \n",
"格 疑即格臈林阿\n",
"汪季庵 \n",
"宋粹生 \n",
"邵莘甫 \n",
"赵晋卿 \n",
"谭和伯 \n",
"日本弈者姓字 \n",
"林门入 \n",
"道硕 \n",
"林朴入 \n",
"算哲 \n",
"算智 \n",
"因策 \n",
"哲斋 \n",
"道悦 \n",
"板垣 \n",
"山家 \n",
"愚硕 \n",
"知哲 \n",
"道策 \n",
"南里 \n",
"朝寻 \n",
"俊知 \n",
"道砂 \n",
"道的 \n",
"道节 \n",
"八硕 \n",
"道智 \n",
"可儿 \n",
"因入 \n",
"井上安节 \n",
"丈和 \n",
"立彻 \n",
"奥贯智策 \n",
"松原南冈 \n",
"舟桥元美 \n",
"水谷琢顺 \n",
"琉球弈者姓字 \n",
"津波 \n",
"元才 \n",
"宫城 \n",
"祝岭 \n",
"孙思忠 \n",
"向盛保 \n",
"杨光裕 \n",
"武邦瑞 \n"
]
}
],
"source": [
"import openpyxl\n",
"\n",
"fi_xls = 'data/对局目录.xlsx'\n",
"\n",
"wb = openpyxl.load_workbook(fi_xls)\n",
"sheet = wb['Sheet2'] \n",
"\n",
"\n",
"for n in range(2,sheet.max_row+1): \n",
" #print(sheet.cell(n,1).value+' ')\n",
" if sheet.cell(n,2).value is not None:\n",
" print(sheet.cell(n,1).value+' '+sheet.cell(n,2).value)\n",
" else:\n",
" print(sheet.cell(n,1).value+' ')"
]
},
{
"cell_type": "markdown",
"metadata": {},
@@ -1395,25 +1655,9 @@
},
{
"cell_type": "code",
"execution_count": 62,
"metadata": {
"execution": {
"iopub.execute_input": "2024-06-30T02:34:13.028764Z",
"iopub.status.busy": "2024-06-30T02:34:13.027355Z",
"iopub.status.idle": "2024-06-30T02:34:14.315546Z",
"shell.execute_reply": "2024-06-30T02:34:14.313944Z",
"shell.execute_reply.started": "2024-06-30T02:34:13.028687Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{\"TextDetections\": [{\"DetectedText\": \"勢上控制敵方此可謂新怖局之一般策略其實準此意義初亦不限定於三連星之形式只須探取與舊法地域主義相反\", \"Confidence\": 99, \"Polygon\": [{\"X\": 66, \"Y\": 45}, {\"X\": 82, \"Y\": 1191}, {\"X\": 45, \"Y\": 1191}, {\"X\": 29, \"Y\": 46}], \"AdvancedInfo\": \"{\\\"Parag\\\":{\\\"ParagNo\\\":13}}\", \"ItemPolygon\": {\"X\": 29, \"Y\": 45, \"Width\": 54, \"Height\": 1147}, \"Words\": [], \"WordCoordPoint\": []}, {\"DetectedText\": \"據現行新依局法之形式觀之大概先以築成三連星之陣形次依第四線及第五線配置與全局保持聯絡於是從大\", \"Confidence\": 96, \"Polygon\": [{\"X\": 104, \"Y\": 93}, {\"X\": 117, \"Y\": 1191}, {\"X\": 79, \"Y\": 1191}, {\"X\": 65, \"Y\": 93}], \"AdvancedInfo\": \"{\\\"Parag\\\":{\\\"ParagNo\\\":19}}\", \"ItemPolygon\": {\"X\": 65, \"Y\": 93, \"Width\": 53, \"Height\": 1099}, \"Words\": [], \"WordCoordPoint\": []}, {\"DetectedText\": \"三四起手更屬實利主義不與敵爭自安於小地到底難望有十分之發展故依實際的參究兩者畢竟俱不適當\", \"Confidence\": 98, \"Polygon\": [{\"X\": 138, \"Y\": 47}, {\"X\": 153, \"Y\": 1095}, {\"X\": 115, \"Y\": 1096}, {\"X\": 100, \"Y\": 47}], \"AdvancedInfo\": \"{\\\"Parag\\\":{\\\"ParagNo\\\":5}}\", \"ItemPolygon\": {\"X\": 100, \"Y\": 47, \"Width\": 54, \"Height\": 1050}, \"Words\": [], \"WordCoordPoint\": []}, {\"DetectedText\": \"侵分之際父易暴露其弱點至於三三起手實屬非常消極之手法毋寧謂屬與新怖局之主旨相背馳換言之即些手比諸\", \"Confidence\": 95, \"Polygon\": [{\"X\": 175, \"Y\": 45}, {\"X\": 189, \"Y\": 1188}, {\"X\": 149, \"Y\": 1188}, {\"X\": 135, \"Y\": 46}], \"AdvancedInfo\": \"{\\\"Parag\\\":{\\\"ParagNo\\\":11}}\", \"ItemPolygon\": {\"X\": 135, \"Y\": 45, \"Width\": 55, \"Height\": 1144}, \"Words\": [], \"WordCoordPoint\": []}, {\"DetectedText\": \"跡不寫人稱道乎其中亦有緣故蓋五五雖亦鴛勢力主義與新怖局法之用意相符願究以離角太遠不便作成根據且在\", \"Confidence\": 95, \"Polygon\": [{\"X\": 209, \"Y\": 45}, {\"X\": 226, \"Y\": 1188}, {\"X\": 187, \"Y\": 1189}, {\"X\": 170, \"Y\": 46}], \"AdvancedInfo\": \"{\\\"Parag\\\":{\\\"ParagNo\\\":12}}\", \"ItemPolygon\": {\"X\": 170, \"Y\": 45, \"Width\": 57, \"Height\": 1145}, \"Words\": [], \"WordCoordPoint\": []}, {\"DetectedText\": \"星一式堪擺寫新佑局法之代表其實三連星式猶如六子局所置之形式一然則三三與五五何以提倡不久即消聲匿\", \"Confidence\": 92, \"Polygon\": [{\"X\": 245, \"Y\": 44}, {\"X\": 261, \"Y\": 1187}, {\"X\": 223, \"Y\": 1187}, {\"X\": 207, \"Y\": 44}], \"AdvancedInfo\": \"{\\\"Parag\\\":{\\\"ParagNo\\\":10}}\", \"ItemPolygon\": {\"X\": 207, \"Y\": 44, \"Width\": 55, \"Height\": 1144}, \"Words\": [], \"WordCoordPoint\": []}, {\"DetectedText\": \"當新布局法初創之時三及五五之起手法會亦盛行一時然不滿一年已皆匿跡今已鮮見探用現所存者唯三連\", \"Confidence\": 98, \"Polygon\": [{\"X\": 282, \"Y\": 90}, {\"X\": 297, \"Y\": 1187}, {\"X\": 259, \"Y\": 1187}, {\"X\": 244, \"Y\": 91}], \"AdvancedInfo\": \"{\\\"Parag\\\":{\\\"ParagNo\\\":18}}\", \"ItemPolygon\": {\"X\": 244, \"Y\": 90, \"Width\": 54, \"Height\": 1098}, \"Words\": [], \"WordCoordPoint\": []}, {\"DetectedText\": \"即以勞力寫第一義地域寫第二義蓋此即新舊兩法根本之差異點也\", \"Confidence\": 94, \"Polygon\": [{\"X\": 315, \"Y\": 42}, {\"X\": 328, \"Y\": 711}, {\"X\": 290, \"Y\": 712}, {\"X\": 277, \"Y\": 43}], \"AdvancedInfo\": \"{\\\"Parag\\\":{\\\"ParagNo\\\":4}}\", \"ItemPolygon\": {\"X\": 277, \"Y\": 42, \"Width\": 52, \"Height\": 671}, \"Words\": [], \"WordCoordPoint\": []}, {\"DetectedText\": \"足取主張起手即擇第四線及第五線配子初時不求固定之地域專圖以勢力制敵篇用戰之策略其觀點適與奮法相反\", \"Confidence\": 97, \"Polygon\": [{\"X\": 353, \"Y\": 41}, {\"X\": 370, \"Y\": 1184}, {\"X\": 330, \"Y\": 1184}, {\"X\": 313, \"Y\": 42}], \"AdvancedInfo\": \"{\\\"Parag\\\":{\\\"ParagNo\\\":9}}\", \"ItemPolygon\": {\"X\": 313, \"Y\": 41, \"Width\": 58, \"Height\": 1144}, \"Words\": [], \"WordCoordPoint\": []}, {\"DetectedText\": \"舊局法既都先佔一及兩邊故類以得地屬第勢力第義自新局論出說斥舊法偏於一隅不\", \"Confidence\": 89, \"Polygon\": [{\"X\": 392, \"Y\": 89}, {\"X\": 406, \"Y\": 1184}, {\"X\": 365, \"Y\": 1184}, {\"X\": 351, \"Y\": 89}], \"AdvancedInfo\": \"{\\\"Parag\\\":{\\\"ParagNo\\\":17}}\", \"ItemPolygon\": {\"X\": 351, \"Y\": 89, \"Width\": 56, \"Height\": 1096}, \"Words\": [], \"WordCoordPoint\": []}, {\"DetectedText\": \"富於變化留白以活動之餘地也\", \"Confidence\": 99, \"Polygon\": [{\"X\": 423, \"Y\": 41}, {\"X\": 427, \"Y\": 358}, {\"X\": 389, \"Y\": 359}, {\"X\": 384, \"Y\": 42}], \"AdvancedInfo\": \"{\\\"Parag\\\":{\\\"ParagNo\\\":2}}\", \"ItemPolygon\": {\"Line truncated
]
}
],
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import json\n",
"import types\n",