main
HuangHai 1 week ago
parent bc4293ebb2
commit 7b1255b612

@ -37,9 +37,12 @@ tasks = [
# { # 数学
# "workspace": "Math", "docx_name": "Math.docx",
# },
{ # 史记
"workspace": "ShiJi", "docx_name": "少年读史记张嘉骅.docx",
},
# { # 史记
# "workspace": "ShiJi", "docx_name": "少年读史记张嘉骅.docx",
# },
{ # 长春市一批次高中学校介绍
"workspace": "ChangChun", "docx_name": "长春市一批次高中学校介绍.docx",
}
]
for task in tasks:
task["docx_path"] = "./static/Txt/" + task["docx_name"] # 3、文档路径 python是按引用传递的&

Binary file not shown.

Before

Width:  |  Height:  |  Size: 737 KiB

@ -1,57 +0,0 @@
import base64
import json
import urllib.request
ENCODING = 'utf-8'
def get_img_base64(img_file):
with open(img_file, 'rb') as infile:
s = infile.read()
return base64.b64encode(s).decode(ENCODING)
def predict(url, appcode, img_base64, kv_configure):
param = {}
param['image'] = img_base64
if kv_configure is not None:
param['configure'] = json.dumps(kv_configure)
body = json.dumps(param)
data = bytes(body, "utf-8")
headers = {'Authorization': 'APPCODE %s' % appcode}
request = urllib.request.Request(url=url, headers=headers, data=data)
try:
response = urllib.request.urlopen(request, timeout=10)
return response.code, response.headers, response.read()
except urllib.request.HTTPError as e:
return e.code, e.headers, e.read()
def demo():
AppKey = '204917800'
AppSecret = 'rmIcdp5is0hM2e4KBC3Ned9aFGBYGU2F'
AppCode = '3a9b1eeacf6a4a7c9b6f3157feb61fa7'
url = 'https://form.market.alicloudapi.com/api/predict/ocr_table_parse'
img_file = '1.png'
# configure = {'side': 'face'}
# 如果没有configure字段configure设为None
# configure = None
configure = {"format": "html", "dir_assure": False, "line_less": True}
img_base64data = get_img_base64(img_file)
stat, header, content = predict(url, AppCode, img_base64data, configure)
if stat != 200:
print('Http status code: ', stat)
print('Error msg in header: ', header['x-ca-error-message'] if 'x-ca-error-message' in header else '')
print('Error msg in body: ', content)
exit()
result_str = content
print(result_str.decode(ENCODING))
# result = json.loads(result_str)
if __name__ == '__main__':
demo()

@ -0,0 +1,35 @@
| | | | |
| --------- | -------------------- | ---- | ----- |
| 一批次666 | 东北师范大学附属中学 | 统招 | 721.6 |
| | 长春市十一高 | 统招 | 710.1 |
| | 长春市二中 | 统招 | 697 |
| | 吉林省实验中学 | 统招 | 690.1 |
| | 长春外国语 | 统招 | 689.6 |
| | 长春市第二实验 | 统招 | 682.1 |
| | 长春市实验 | 统招 | 676.8 |
| | 长春市六中 | 统招 | 666 |
| | 长春汽车厂六中 | 统招 | 666 |
| 二批次586 | 师大青华 | 私立 | 705.6 |
| | 吉大 | 私立 | 701.1 |
| | 二中精致 | 私立 | 687.3 |
| | 八中 | 统招 | 677 |
| | 五中 | 统招 | 664 |
| | 省实验繁荣 | 私立 | 662.3 |
| | 希望 | 统招 | 651.4 |
| | 师大净月慧泽 | 私立 | 651 |
| | 北师大博硕 | 私立 | 646.9 |
| | 十七中 | 统招 | 643.3 |
| | 汽三 | 统招 | 637.6 |
| | 一中 | 统招 | 633.5 |
| | 北湖 | 私立 | 630.5 |
| | 二十九中 | 统招 | 624.8 |
| | 养正 | 统招 | 623.3 |
| | 十中 | 统招 | 620.5 |
| | 文理 | 私立 | 616.4 |
| | 七中 | 统招 | 614.4 |
| | 朝中 | 统招 | 613.8 |
| | 一三七中学 | 统招 | 611.8 |
| | 解放 | 私立 | 608.2 |
| | 力旺 | 私立 | 586 |
| | 日章学园 | 私立 | 586 |
| | 清浦 | 私立 | 586 |

@ -0,0 +1,7 @@
长春市2025年中考各批次录取最低控制线确定如下
第一批次城区普通高中 689分
第二批次城区普通高中 590分
第三批次城区普通高中 573分
中等职业学校的综合高中班录取不低于第三批次城区普通高中最低控制线下60分。
来源:长春市教育考试院
Loading…
Cancel
Save