ceshi.py 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. # !/usr/bin/env/python
  2. # -*- coding:utf-8 -*-
  3. from flask import Flask, render_template, request
  4. from datetime import timedelta
  5. import requests
  6. from utils.img2latex import get_ocrlatex_by_url
  7. headers = {'Pragma': 'no-cache', 'Cache-Control': 'no-cache',
  8. 'X-USER-TOKEN': 'eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIyMCIsInVzZXJOYW1lIjoiSFgwMDEyMTM4IiwiZXhwIjoxNTY2Mzg3ODA1LCJ1c2VySWQiOiIyMCIsImlhdCI6MTU2NjM3MzQwNX0.9w__2RGncpdMvbiQAmk75ThgPwDaTXF1VyY1xKVs_zFduUEoJ3_6X2q3ZVYsFIpChKeLEWelhwlmMxEP4lU9QA',
  9. 'Origin': 'http://xx.cn',
  10. 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.157 Safari/537.36',
  11. 'Accept': '*/*',
  12. # 'Content-Type': 'multipart/form-data; boundary=----WebKitFormBoundarycDnnz7eKalCPv6GJ',
  13. 'Referer': '', 'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8'}
  14. url = "http://192.168.1.140:18085/upload"
  15. import json
  16. data = {'callback_url': "http://zsytk.dev.xueping.com/wordapi/index/wid/9668",
  17. "mydata": json.dumps([{"file_type": "", "file_url": "http://zsytk.dev.xueping.com/data/word/2020/08/5f327c08f3576.doc"}],ensure_ascii=False).encode("utf-8")
  18. }
  19. # print(requests.Request('POST', url, data=data, json=json).prepare().body.decode(
  20. # 'ascii')) # 打印字段名和类型
  21. # r = requests.post(url, data=data, headers=headers)
  22. # print(r.text)
  23. #
  24. # { %
  25. # for sub in item[2:5] %}
  26. # { % if "src" in sub %}
  27. # < img
  28. # src = "data:;base64,{{ img_stream }}" >
  29. # { % endif %}
  30. # { % endfor %}
  31. import re
  32. pattern_2 = re.compile(
  33. r"(([CDE]\s*[..、、]|\([CDE]\)).+?)(?<![::])\s\(([1-9]|1[0-9])\)(.+?([是为有]|等于)[((]\s*[))]\n)")
  34. w1 = "C.jfg (3)mvm等于()\n"
  35. # p1=re.search(r"每(小?题|空)[\u4e00-\u9fa5]{,5}(\d[\d.]{,2}\d{,2})分", "二、填空题(每空2分,共8分)")
  36. # print(p1)
  37. # p2 = re.findall("([1-9]|[1-4][0-9])[))]?\s*(?=题)", "33题")
  38. # print(p2)
  39. #
  40. # print(list(range(1,2)))
  41. # print("{0}{1}".format(3,5))
  42. # def fun1(nn, **kwargs):
  43. # print(kwargs)
  44. # print(kwargs['index'])
  45. # fun1(1, all_type=1, num=2, index=3)
  46. # print(2==2>3)
  47. # p1 = re.search("(?<![::..、、])\s+([1-9]|[1-4][0-9])\s*[..、、](?!png)", 'yy 49.png')
  48. # print(p1)
  49. # items_str = '\n1.yy22.pn'
  50. #
  51. # for no in re.findall(r'\n+\s*([1-9]|[1-4][0-9])\s*[..、、]|(?<![::..、、])\s*([1-9]|[1-4][0-9])\s*[..、、](?!png)', items_str):
  52. # print(no)
  53. #
  54. # con_id_line = [] # 题号的行索引,第几行
  55. # topicno = [] # 题号序列
  56. # topicno_line_dict = dict(zip([], [])) # 题号to行索引字典
  57. # print(len(topicno_line_dict))
  58. # print("$\\frac")
  59. #
  60. # w_info = re.search(' width="(\d+[.\d]*?)\s*([pxt]?)"', ' width="16"')
  61. # print(w_info.group(1),w_info.group(2))
  62. #
  63. # ee = [1,2,3]
  64. # ee=sorted(ee,reverse=True)
  65. # print(ee)
  66. # from PIL import Image
  67. # local_p = r"F:\zwj\Text_Structure\img_folder\5fc64a514994183dda7e74ea\new_image1624343877418770.png"
  68. # w = Image.open(local_p)
  69. # w.close()
  70. from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor
  71. #
  72. # kk = open(r"F:\zwj\parse_online58\res_folder\76736f316fe30323c8ddc51cf2b3f392__2021_08_30_10_15_58__828__1870.json",
  73. # 'r', encoding='utf-8')
  74. # con=json.loads(kk.read())
  75. # item_str = str(con['items'][4])
  76. # item_str = re.sub('(<img src=".*?".*? data-latex=)"\$.+?\$"',r'\1""', item_str)
  77. # print(eval(item_str))
  78. # print('------------------------------------')
  79. # all_imgs_no_latex = re.findall(r'(<img src="(.*?)".*? data-latex="\$?\s*\$?")', item_str)
  80. # if all_imgs_no_latex:
  81. # imgurl_no_latex = [k[1] for k in all_imgs_no_latex]
  82. # imgurl_no_latex = list(set(imgurl_no_latex))
  83. # print(imgurl_no_latex)
  84. # print('--------------------------------')
  85. # # mathpixs = []
  86. # # if len(imgurl_no_latex) <= 20:
  87. # # mathpixs.extend([get_ocrlatex_by_url(i) for i in imgurl_no_latex])
  88. # # else:
  89. # # if len(imgurl_no_latex) <= 50:
  90. # # executor = ThreadPoolExecutor(max_workers=2) # 开2个线程会稍微快点
  91. # # else:
  92. # # executor = ThreadPoolExecutor(max_workers=4)
  93. # # for data in executor.map(get_ocrlatex_by_url, imgurl_no_latex):
  94. # # mathpixs.append(data)
  95. # mathpixs = [' 1: 1 ', ' b ', ')', ' 1: 1 ', '', ' a^{2}: b^{2} ', '(', 'R _ { 1 } = \\frac { p h } { a ^ { 2 } }', 'R _ { 2 } = \\frac { p b } { b h } = \\frac { p } { h }', ' a: b ', ' h ', ' R_{1}: R_{2}=b^{2}: a^{2} ', ' R_{2}=\\frac{\\rho h}{b^{2}} ', ' a: b ', ' a ']
  96. #
  97. # def sub1(ss):
  98. # new_ss = ss.group(1) + ' data-type="math-ocr" ocr-latex="$'+mathpixs[mi]+'$"'+ss.group(2)
  99. # return new_ss.replace(' data-type="math"', "")
  100. # # r'\1 ocr-latex="${}$"'.format(mathpixs[mi])
  101. # for mi, m in enumerate(imgurl_no_latex):
  102. # # item_str = re.sub(r'(<img src="' + m + r'".*?) data-latex="\$?\s*\$?"',
  103. # # sub1, item_str)
  104. # if mathpixs[mi]:
  105. # item_str = re.sub(r'(<img src="{}".*?) data-latex="\$?\s*\$?"(.*?(?<=")\s*/?>)'.format(m),
  106. # sub1, item_str)
  107. #
  108. # items_list = eval(item_str)
  109. # print(items_list)
  110. # 入库时将latex替换为图片测试
  111. from pprint import pprint
  112. ltx2url = {"\\begin{array}{cccccccc}& \\text{CO}& \\text{+}& {\\text{H}}_{\\text{2}}\\text{S}& \\stackrel{}{⇌}& \\text{COS}& \\text{+}& {\\text{H}}_{\\text{2}}\\\\ 开始\\text{/mol}& \\text{a}& & \\text{a}& & \\text{0}& & \\text{0}\\\\ 转化\\text{/mol}& \\text{x}& & \\text{x}& & \\text{x}& & \\text{x}\\\\ 平衡\\text{/mol}& \\text{a-x}& & \\text{a-x}& & \\text{x}& & \\text{x}\\end{array}": "<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146164642.png\" width=\"293.5\" height=\"87.5\" data-latex=\"$\\begin{array}{cccccccc}& \\text{CO}& \\text{+}& {\\text{H}}_{\\text{2}}\\text{S}& \\stackrel{}{⇌}& \\text{COS}& \\text{+}& {\\text{H}}_{\\text{2}}\\\\ 开始\\text{/mol}& \\text{a}& & \\text{a}& & \\text{0}& & \\text{0}\\\\ 转化\\text{/mol}& \\text{x}& & \\text{x}& & \\text{x}& & \\text{x}\\\\ 平衡\\text{/mol}& \\text{a-x}& & \\text{a-x}& & \\text{x}& & \\text{x}\\end{array}$\" />",}
  113. def sub2(s):
  114. if s:
  115. all_ltx = re.findall(r'\$.*?\$', s) # 查找试题结构中的公式
  116. all_ltx.extend(re.findall('\\\\\(.*?\\\\\)', s))
  117. all_ltx = list(set(all_ltx))
  118. for ltx in all_ltx:
  119. new_ltx = ltx.replace("$", "").replace("\\(", "").replace("\\)", "").replace("&amp;", "&")
  120. if new_ltx in ltx2url: # 将latex换为其渲染图片的线上可访问地址
  121. s = s.replace(ltx, ltx2url[new_ltx])
  122. return s
  123. items_res_to_xbk = [
  124. {"repeat_res": [],
  125. "topic_type_id": 40,
  126. "stem": "含硫废气的处理越来越成为化工生产等领域的重要课题。回答下列问题:<br/>Ⅰ.CO可将工业尾气中的<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146482015.png\" width=\"26.0\" height=\"14.5\" data-latex=\"${\\text{H}}_{2}\\text{S}$\" />转化为化工原料羰基硫(COS):<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146530797.png\" width=\"240.5\" height=\"20.5\" data-latex=\"${\\text{CO(g)+H}}_{\\text{2}}\\text{S(g)}\\stackrel{}{⇌}{\\text{COS(g)+H}}_{\\text{2}}\\text{(g)}\\text{ }\\text{ΔH}$\" />。<br/>(1)恒温恒容条件下,密闭容器中发生上述反应,下列事实不能说明反应达到平衡状态的是_______(填序号)。<br/>a.<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146716339.png\" width=\"111.0\" height=\"19.5\" data-latex=\"${\\text{v}}_{\\text{正}}{\\text{(CO)=v}}_{\\text{正}}\\left({\\text{H}}_{\\text{2}}\\right)$\" /><br/>b.COS和<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146675305.png\" width=\"17.5\" height=\"14.5\" data-latex=\"${\\text{H}}_{2}$\" />的浓度之和保持不变<br/>c.混合气体的平均相对分子质量不变<br/>d.单位时间内断裂<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146920796.png\" width=\"36.0\" height=\"13.5\" data-latex=\"$\\text{H}-\\text{S}$\" />键与断裂<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/image187.png\" width=\"30px\" height=\"14px\" data-type=\"math\" data-latex=\"$$\">键数目相等<br/>(2)T℃时,在恒容的密闭容器中充入等物质的量CO和<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146482015.png\" width=\"26.0\" height=\"14.5\" data-latex=\"${\\text{H}}_{2}\\text{S}$\" />发生反应,实验测得反应前容器内压强为<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146672571.png\" width=\"39.5\" height=\"16.5\" data-latex=\"${\\text{p}}_{\\text{0}}\\text{kPa}$\" />,10min达到平衡时<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146675305.png\" width=\"17.5\" height=\"14.5\" data-latex=\"${\\text{H}}_{2}$\" />的分压为<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146310577.png\" width=\"39.5\" height=\"15.5\" data-latex=\"${\\text{p}}_{\\text{1}}\\text{kPa}$\" />。<br/>①CO的平衡转化率为_______(用含<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146661244.png\" width=\"14.5\" height=\"12.5\" data-latex=\"${\\text{p}}_{\\text{0}}$\" />、<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146698360.png\" width=\"14.5\" height=\"12.5\" data-latex=\"${\\text{p}}_{\\text{1}}$\" />的代数式表示),<br/>②该反应的平衡常数<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146139140.png\" width=\"30.0\" height=\"16.5\" data-latex=\"${\\text{K}}_{\\text{p}}\\text{=}$\" />_______(用含<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146661244.png\" width=\"14.5\" height=\"12.5\" data-latex=\"${\\text{p}}_{\\text{0}}$\" />、<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146698360.png\" width=\"14.5\" height=\"12.5\" data-latex=\"${\\text{p}}_{\\text{1}}$\" />的代数式表示,列出表达式即可)。<br/>(3)在某密闭容器中,以一定投料比进行上述反应,相同时间内<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146482015.png\" width=\"26.0\" height=\"14.5\" data-latex=\"${\\text{H}}_{2}\\text{S}$\" />的转化率与温度(T)的关系如图所示,<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146464435.png\" width=\"22.5\" height=\"13.5\" data-latex=\"$\\text{ΔH}$\" />_______(填“>”或“&lt;”)0,其原因是_______。<br/><img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/image194.png\" width=\"156px\" height=\"124px\"><br/>Ⅱ.工业尾气中的<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806145613125.png\" width=\"26.0\" height=\"14.5\" data-latex=\"${\\text{SO}}_{2}$\" />是环境污染的主要原因之一,工业上可采用钙基固硫法或电解法降低尾气中的含硫量。<br/>(4)已知:<br/>a.<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146475676.png\" width=\"201.0\" height=\"17.5\" data-latex=\"$\\text{CaO}\\left(\\text{s}\\right)+{\\text{CO}}_{2}\\left(\\text{g}\\right)={\\text{CaCO}}_{3}\\left(\\text{s}\\right)$\" /><img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146423692.png\" width=\"148.5\" height=\"17.5\" data-latex=\"$\\text{ΔH=}-178.3\\text{kJ}\\cdot {\\text{mol}}^{-1}$\" /><br/>b.<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146176891.png\" width=\"365.5\" height=\"17.5\" data-latex=\"$2{\\text{CaCO}}_{3}\\left(\\text{s}\\right)+2{\\text{SO}}_{2}\\left(\\text{g}\\right)+{\\text{O}}_{2}\\left(\\text{g}\\right)=2{\\text{CaSO}}_{4}\\left(\\text{s}\\right)+2{\\text{CO}}_{2}\\left(\\text{g}\\right)$\" /><img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146792016.png\" width=\"156.0\" height=\"17.5\" data-latex=\"$\\text{ΔH=}-2762.2\\text{kJ}\\cdot {\\text{mol}}^{-1}$\" /><br/>c.<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146273320.png\" width=\"216.5\" height=\"17.5\" data-latex=\"$2{\\text{CaSO}}_{3}\\left(\\text{s}\\right)+{\\text{O}}_{2}\\left(\\text{g}\\right)=2{\\text{CaSO}}_{4}\\left(\\text{s}\\right)$\" /><img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146340678.png\" width=\"156.0\" height=\"17.5\" data-latex=\"$\\text{ΔH=}-2314.8\\text{kJ}\\cdot {\\text{mol}}^{-1}$\" /><br/>则<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146990429.png\" width=\"195.5\" height=\"17.5\" data-latex=\"$\\text{CaO}\\left(\\text{s}\\right)+{\\text{SO}}_{2}\\left(\\text{g}\\right)={\\text{CaSO}}_{3}\\left(\\text{s}\\right)$\" /><img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146895880.png\" width=\"34.0\" height=\"13.5\" data-latex=\"$\\text{ΔH=}$\" />_______。在一定温度下,该反应达到平衡时向容器中通入少量<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806145613125.png\" width=\"26.0\" height=\"14.5\" data-latex=\"${\\text{SO}}_{2}$\" />,则反应再次达到平衡时<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146856073.png\" width=\"45.5\" height=\"17.5\" data-latex=\"$\\text{c}\\left({\\text{SO}}_{\\text{2}}\\right)$\" />将_______(填“增大”“减小”或“不变”)。<br/>(5)利用如图所示装置可吸收工业尾气中的<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806145613125.png\" width=\"26.0\" height=\"14.5\" data-latex=\"${\\text{SO}}_{2}$\" />,同时还可吸收尾气中的NO。电解池中膜c为_______(填“阴”或“阳”)离子交换膜,阴极的电极反应为_______,当利用此装置吸收标准状况下2.24LNO时,阳极区溶液质量变化量为_______。<br/><img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/image204.png\" width=\"243px\" height=\"111px\">",
  127. "key": "(1)acd<br/>(2) <img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146744789.png\" width=\"60.0\" height=\"25.0\" data-latex=\"$\\frac{{\\text{2p}}_{\\text{1}}}{{\\text{p}}_{\\text{0}}}×100%$\" /> <img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146629454.png\" width=\"50.0\" height=\"39.5\" data-latex=\"$\\frac{{\\text{p}}_{\\text{1}}^{\\text{2}}}{{\\left(\\frac{{\\text{p}}_{\\text{0}}}{\\text{2}}{\\text{-p}}_{\\text{1}}\\right)}^{\\text{2}}}$\" /><br/>(3) &lt; 反应达平衡后,温度升高,<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146482015.png\" width=\"26.0\" height=\"14.5\" data-latex=\"${\\text{H}}_{2}\\text{S}$\" />的转化率降低,升温平衡逆向移动,故正反应方向为放热反应<br/>(4) -402kJ/mol 不变<br/>(5) 阳 <img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146203698.png\" width=\"246.5\" height=\"19.5\" data-latex=\"$2{\\text{HSO}}_{3}^{-}+2{\\text{e}}^{-}+2{\\text{H}}^{+}={\\text{S}}_{2}{\\text{O}}_{4}^{2-}+2{\\text{H}}_{2}\\text{O}$\" /> 6.2g",
  128. "parse": "(1)a.任意时刻均有<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146716339.png\" width=\"111.0\" height=\"19.5\" data-latex=\"${\\text{v}}_{\\text{正}}{\\text{(CO)=v}}_{\\text{正}}\\left({\\text{H}}_{\\text{2}}\\right)$\" />,反应不一定达到了平衡,a符合题意;<br/>b.COS和<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146675305.png\" width=\"17.5\" height=\"14.5\" data-latex=\"${\\text{H}}_{2}$\" />的浓度之和保持不变,说明正逆反应速率相等,达到了平衡,b不符合题意;<br/>c.反应物生成物都是气体,质量守恒不变,气体的物质的量不变,故混合气体的平均相对分子质量永远不变,故混合气体的平均相对分子质量不变不一定达到了平衡,c符合题意;<br/>d.反应达到平衡时,单位时间内断裂2个<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146920796.png\" width=\"36.0\" height=\"13.5\" data-latex=\"$\\text{H}-\\text{S}$\" />键同时断裂1个<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146590734.png\" width=\"41.5\" height=\"12.5\" data-latex=\"$\\text{C}=\\text{O}$\" />,故断裂<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146920796.png\" width=\"36.0\" height=\"13.5\" data-latex=\"$\\text{H}-\\text{S}$\" />键与断裂<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146590734.png\" width=\"41.5\" height=\"12.5\" data-latex=\"$\\text{C}=\\text{O}$\" />键数目相等时,没有达到了平衡,d符合题意;<br/>答案选acd;<br/>(2)根据题意,设初始的CO的物质的量为amol,转化了xmol,可得$\\begin{array}{cccccccc}&amp; \\text{CO}&amp; \\text{+}&amp; {\\text{H}}_{\\text{2}}\\text{S}&amp; \\stackrel{}{⇌}&amp; \\text{COS}&amp; \\text{+}&amp; {\\text{H}}_{\\text{2}}\\\\ 开始\\text{/mol}&amp; \\text{a}&amp; &amp; \\text{a}&amp; &amp; \\text{0}&amp; &amp; \\text{0}\\\\ 转化\\text{/mol}&amp; \\text{x}&amp; &amp; \\text{x}&amp; &amp; \\text{x}&amp; &amp; \\text{x}\\\\ 平衡\\text{/mol}&amp; \\text{a-x}&amp; &amp; \\text{a-x}&amp; &amp; \\text{x}&amp; &amp; \\text{x}\\end{array}$<br/>测得反应前容器内压强为<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146672571.png\" width=\"39.5\" height=\"16.5\" data-latex=\"${\\text{p}}_{\\text{0}}\\text{kPa}$\" />,10min达到平衡时<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146675305.png\" width=\"17.5\" height=\"14.5\" data-latex=\"${\\text{H}}_{2}$\" />的分压为<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146310577.png\" width=\"39.5\" height=\"15.5\" data-latex=\"${\\text{p}}_{\\text{1}}\\text{kPa}$\" />,则P<sub>0</sub><img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146129186.png\" width=\"15.5\" height=\"18.5\" data-latex=\"$\\frac{\\text{x}}{\\text{2a}}$\" />=P<sub>1</sub>,<br/>①CO的平衡转化率为<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146613037.png\" width=\"10.0\" height=\"17.5\" data-latex=\"$\\frac{\\text{x}}{\\text{a}}$\" />×100%=<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146744789.png\" width=\"60.0\" height=\"25.0\" data-latex=\"$\\frac{{\\text{2p}}_{\\text{1}}}{{\\text{p}}_{\\text{0}}}×100%$\" />;<br/>②该反应的平衡常数<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146711255.png\" width=\"100.0\" height=\"35.0\" data-latex=\"${\\text{K}}_{\\text{p}}\\text{=}\\frac{\\frac{\\mathrm{x}}{2\\mathrm{a}}{\\text{p}}_{0}×\\frac{\\mathrm{x}}{2\\mathrm{a}}{\\mathrm{p}}_{0}}{\\frac{\\mathrm{a}-\\mathrm{x}}{2\\mathrm{a}}{\\text{p}}_{0}×\\frac{\\mathrm{a}-\\mathrm{x}}{2\\mathrm{a}}{\\mathrm{p}}_{0}}$\" />=<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146629454.png\" width=\"50.0\" height=\"39.5\" data-latex=\"$\\frac{{\\text{p}}_{\\text{1}}^{\\text{2}}}{{\\left(\\frac{{\\text{p}}_{\\text{0}}}{\\text{2}}{\\text{-p}}_{\\text{1}}\\right)}^{\\text{2}}}$\" />;<br/>(3)反应达平衡后,温度升高,<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146482015.png\" width=\"26.0\" height=\"14.5\" data-latex=\"${\\text{H}}_{2}\\text{S}$\" />的转化率降低,升温平衡逆向移动,故正反应方向为放热反应。<br/>(4)已知:<br/>a.<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146475676.png\" width=\"201.0\" height=\"17.5\" data-latex=\"$\\text{CaO}\\left(\\text{s}\\right)+{\\text{CO}}_{2}\\left(\\text{g}\\right)={\\text{CaCO}}_{3}\\left(\\text{s}\\right)$\" /><img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146423692.png\" width=\"148.5\" height=\"17.5\" data-latex=\"$\\text{ΔH=}-178.3\\text{kJ}\\cdot {\\text{mol}}^{-1}$\" /><br/>b.<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146176891.png\" width=\"365.5\" height=\"17.5\" data-latex=\"$2{\\text{CaCO}}_{3}\\left(\\text{s}\\right)+2{\\text{SO}}_{2}\\left(\\text{g}\\right)+{\\text{O}}_{2}\\left(\\text{g}\\right)=2{\\text{CaSO}}_{4}\\left(\\text{s}\\right)+2{\\text{CO}}_{2}\\left(\\text{g}\\right)$\" /><img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146792016.png\" width=\"156.0\" height=\"17.5\" data-latex=\"$\\text{ΔH=}-2762.2\\text{kJ}\\cdot {\\text{mol}}^{-1}$\" /><br/>c.<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146273320.png\" width=\"216.5\" height=\"17.5\" data-latex=\"$2{\\text{CaSO}}_{3}\\left(\\text{s}\\right)+{\\text{O}}_{2}\\left(\\text{g}\\right)=2{\\text{CaSO}}_{4}\\left(\\text{s}\\right)$\" /><img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146340678.png\" width=\"156.0\" height=\"17.5\" data-latex=\"$\\text{ΔH=}-2314.8\\text{kJ}\\cdot {\\text{mol}}^{-1}$\" />根据盖斯定律(b-c)/2+a即得到CaO(s)与SO<sub>2</sub>(g)反应生成CaSO<sub>3</sub>(s)的热化学方程式<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146990429.png\" width=\"195.5\" height=\"17.5\" data-latex=\"$\\text{CaO}\\left(\\text{s}\\right)+{\\text{SO}}_{2}\\left(\\text{g}\\right)={\\text{CaSO}}_{3}\\left(\\text{s}\\right)$\" /><img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146895880.png\" width=\"34.0\" height=\"13.5\" data-latex=\"$\\text{ΔH=}$\" />-402kJ/mol;<br/>(5)b电极为H<sub>2</sub>O放电生成O<sub>2</sub>与H<sup>+</sup>,稀硫酸进入生成了浓硫酸,故电解池中膜c为阳离子交换膜;阴极得到电子发生还原反应,根据图可知是HSO<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146412419.png\" width=\"9.0\" height=\"18.5\" data-latex=\"${}_{3}^{-}$\" />在酸性条件下发生还原反应,生成S<sub>2</sub>O<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146227735.png\" width=\"14.5\" height=\"19.5\" data-latex=\"${}_{4}^{2-}$\" />,其电极反应式为<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146203698.png\" width=\"246.5\" height=\"19.5\" data-latex=\"$2{\\text{HSO}}_{3}^{-}+2{\\text{e}}^{-}+2{\\text{H}}^{+}={\\text{S}}_{2}{\\text{O}}_{4}^{2-}+2{\\text{H}}_{2}\\text{O}$\" />;根据图示,吸收池中S<sub>2</sub>O<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146227735.png\" width=\"14.5\" height=\"19.5\" data-latex=\"${}_{4}^{2-}$\" />和NO是反应物,N<sub>2</sub>和HSO<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146412419.png\" width=\"9.0\" height=\"18.5\" data-latex=\"${}_{3}^{-}$\" />是生成物,则吸收池中除去NO的原理是2NO+2S<sub>2</sub>O<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146227735.png\" width=\"14.5\" height=\"19.5\" data-latex=\"${}_{4}^{2-}$\" />+2H<sub>2</sub>O=N<sub>2</sub>+4HSO<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146412419.png\" width=\"9.0\" height=\"18.5\" data-latex=\"${}_{3}^{-}$\" />,标准状况下2.24LNO即0.1molNO时,需要0.1molS<sub>2</sub>O<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6221c7e9a7d375f4518b99b5/MJMATH-1646806146227735.png\" width=\"14.5\" height=\"19.5\" data-latex=\"${}_{4}^{2-}$\" />,则转移0.2mol电子,根据反应2SO<sub>2</sub>+O<sub>2</sub>=2SO<sub>3</sub>,阳极吸收0.1molSO<sub>2</sub>,质量增加为0.1mol×64g/mol=6.4g,通过阳离子交换膜的H<sup>+</sup>为0.2mol,质量减少0.2mol×1g/mol=0.2g,阳极区溶液质量变化量为6.4g-0.2g=6.2g。<br/>"}
  129. ]
  130. for one_items in items_res_to_xbk:
  131. keys_items = ["stem", "key", "parse", "analysis", "options"]
  132. # if one_items['img_status'] == 1 and ("stem_img" in one_items and one_items["stem_img"].strip()):
  133. # keys_items = ["stem_img", "key_img", "parse_img", "options_img"]
  134. for k in keys_items:
  135. if k in one_items:
  136. if k == "options":
  137. one_items[k] = list(map(sub2, one_items[k]))
  138. else:
  139. one_items[k] = sub2(one_items[k])
  140. # pprint(items_res_to_xbk[0])
  141. # ^(\s*<imgsrc.*?[/\"]>\s*)+?(参考|考试|试[题卷]|物理|理综|数学|化学|生物)(答案|解析|答案[及与和]评分(标准|意见|细则))\s*$'
  142. # r'|^(\s*<imgsrc.*?[/\"]>\s*)+?评分标准'
  143. print(99999999999999)
  144. # ss1 = r"<imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/>第Ⅱ卷非选择题,共分"
  145. # ss = "<imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/><imgsrcw_h=*/>第Ⅱ卷非选择题,共分"
  146. # if re.search(r'^(\s*<imgsrcw_h=[^/\"]*?(data-latex=.*?)?[/\"]>\s*)+?(?=errr)',ss1):
  147. # print(222222222222222222)
  148. bb = """
  149. 一列简谐横波沿直线传播, 该直线上的 a、b 两点相距 4.42 m. 图中实、虚两条曲线分 别表示平衡位置在 a、b 两点处质点的振动曲线.从图示可知( )
  150. A.此列波的频率一定是 10Hz
  151. B.此列波的波长一定是 0.1m
  152. C.此列波的传播速度可能是 34 m/s
  153. D .a 点一定比b 点距波源近
  154. <imgsrc37 w_h=1*6/><imgsrc38 w_h=133*197/><imgsrc39 w_h=11*13/><imgsrc40 w_h=12*13/><imgsrc41 w_h=11*13/><imgsrc42 w_h=97*49/><imgsrc43 w_h=28*4/><imgsrc44 w_h=10*11/><imgsrc45 w_h=12*13/><imgsrc46 w_h=2*7/><imgsrc47 w_h=17*15/><imgsrc48 w_h=177*51/><imgsrc49 w_h=1*111/><imgsrc51 w_h=26*27/><imgsrc52 w_h=34*1/><imgsrc53 w_h=1*28/><imgsrc54 w_h=13*13/><imgsrc55 w_h=29*57/><imgsrc56 w_h=1*9/><imgsrc57 w_h=1*8/><imgsrc58 w_h=3*13/><imgsrc59 w_h=2*12/><imgsrc60 w_h=3*13/><imgsrc61 w_h=13*11/><imgsrc62 w_h=5*2/><imgsrc63 w_h=5*2/><imgsrc64 w_h=1*20/><imgsrc65 w_h=235*1/><imgsrc66 w_h=3*26/><imgsrc67 w_h=21*13/><imgsrc60 w_h=3*13/><imgsrc68 w_h=5*2/><imgsrc69 w_h=28*7/><imgsrc70 w_h=14*6/><imgsrc71 w_h=14*6/><imgsrc72 w_h=19*24/><imgsrc73 w_h=17*1/><imgsrc74 w_h=2*7/><imgsrc75 w_h=26*23/>第Ⅱ卷 (非选择题,共 52 分)
  155. 【未识别图片】
  156. """
  157. # end_pic = re.findall(r"\n(<imgsrc\d+ w_h=[\d.]+\*[\d.]+(\sdata-latex=.*?\")?\s*/>\s*"
  158. # r"(<imgsrc\d+ w_h=[\d.]+\*[\d.]+(\sdata-latex=.*?\")?\s*/>)*?)\n?$",
  159. # bb)
  160. #
  161. # print(end_pic)
  162. print(chr(ord('@')+1))
  163. option_con = """
  164. 一列简谐横波沿直线传播, 该直线上的 a、b 两点相距 4.42 m. 图中实、虚两条曲线分 别表示平衡位置在 a、b 两点处质点的振动曲线.从图示可知( )
  165. A.此列波的频率一定是 10Hz
  166. B.此列波的波长一定是 0.1m
  167. C.此列波的传播速度可能是 34 m/s
  168. D .a 点一定比b 点距波源近
  169. <img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6258cc7af84c0e279ac64301/image37.png" width="1px" height="6px" /><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6258cc7af84c0e279ac64301/image38.png" width="133px" height="197px" /><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6258cc7af84c0e279ac64301/image39.png" width="11px" height="13px" /><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6258cc7af84c0e279ac64301/image40.png" width="12px" height="13px" /><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6258cc7af84c0e279ac64301/image41.png" width="11px" height="13px" /><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6258cc7af84c0e279ac64301/image42.png" width="97px" height="49px" /><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6258cc7af84c0e279ac64301/image43.png" width="28px" height="4px" /><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6258cc7af84c0e279ac64301/image44.png" width="10px" height="11px" /><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6258cc7af84c0e279ac64301/image45.png" width="12px" height="13px" /><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6258cc7af84c0e279ac64301/image46.png" width="2px" height="7px" /><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6258cc7af84c0e279ac64301/image47.png" width="17px" height="15px" /><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6258cc7af84c0e279ac64301/image48.png" width="177px" height="51px" /><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6258cc7af84c0e279ac64301/image49.png" width="1px" height="111px" /><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6258cc7af84c0e279ac64301/image51.png" width="26px" height="27px" /><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6258cc7af84c0e279ac64301/image52.png" width="34px" height="1px" /><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6258cc7af84c0e279ac64301/image53.png" width="1px" height="28px" /><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6258cc7af84c0e279ac64301/image54.png" width="13px" height="13px" /><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6258cc7af84c0e279ac64301/image55.png" width="29px" height="57px" /><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6258cc7af84c0e279ac64301/image56.png" width="1px" height="9px" /><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6258cc7af84c0e279ac64301/image57.png" width="1px" height="8px" /><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6258cc7af84c0e279ac64301/image58.png" width="3px" height="13px" /><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6258cc7af84c0e279ac64301/image59.png" width="2px" height="12px" /><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6258cc7af84c0e279ac64301/image60.png" width="3px" height="13px" /><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6258cc7af84c0e279ac64301/image61.png" width="13px" height="11px" /><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6258cc7af84c0e279ac64301/image62.png" width="5px" height="2px" /><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6258cc7af84c0e279ac64301/image63.png" width="5px" height="2px" /><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6258cc7af84c0e279ac64301/image64.png" width="1px" height="20px" /><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6258cc7af84c0e279ac64301/image65.png" width="235px" height="1px" /><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6258cc7af84c0e279ac64301/image66.png" width="3px" height="26px" /><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6258cc7af84c0e279ac64301/image67.png" width="21px" height="13px" /><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6258cc7af84c0e279ac64301/image60.png" width="3px" height="13px" /><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6258cc7af84c0e279ac64301/image68.png" width="5px" height="2px" /><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6258cc7af84c0e279ac64301/image69.png" width="28px" height="7px" /><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6258cc7af84c0e279ac64301/image70.png" width="14px" height="6px" /><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6258cc7af84c0e279ac64301/image71.png" width="14px" height="6px" /><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6258cc7af84c0e279ac64301/image72.png" width="19px" height="24px" /><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6258cc7af84c0e279ac64301/image73.png" width="17px" height="1px" /><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6258cc7af84c0e279ac64301/image74.png" width="2px" height="7px" /><img src="http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/6258cc7af84c0e279ac64301/image75.png" width="26px" height="23px" />第Ⅱ卷 (非选择题,共 52 分)
  170. 【未识别图片】
  171. """
  172. # option_con = re.sub(r"(\n\s*(<img\s*src=.+?[\"/]>\s*)+?\s*)(A[、、..::].+?)",
  173. # r"\1\n\3", str(option_con),flags=re.S)
  174. # print(option_con)
  175. pkk = "二、(每小题有4个选项)"
  176. pkk = re.sub(r'([一二三四五六七八九十])\s*[、..、,,::]?\s*([((]\s*(每小题|本大?题)((?!选项).)+?[))]|综合题)',
  177. r"\1" + "、" + "解答题", pkk)
  178. print(pkk)
  179. # callback_url = "http://zsyte.zhixinhuixue.com/parseapi/index/sid/2510/wid/190969"
  180. # fp = open(r"E:\Text_Structure\res_folder\6290b90df84c0e279ac64824__2022_05_30_09_35_33.json", 'r',encoding='utf-8').read()
  181. # res_xbk = json.loads(fp)
  182. # # print(res_xbk)
  183. # r = requests.post(callback_url,
  184. # # json=res, # 可以,但是会进行转义
  185. # data=json.dumps(res_xbk, ensure_ascii=False).encode("utf-8"), # 文件开头有编码显示
  186. # )
  187. # print(r.status_code,r.text)
  188. chachong_item_dict = {'topic_id': 3, 'subject_id': 41, 'topic_type_id': 20, 'content': '下列各组数中,能作为直角三角形边长的是( )',
  189. 'options': ['$4$,$5$,$6$', '$12$,$16$,$20$', '$5$,$10$,$13$', '$8$,$40$,$41$']}
  190. chachong_item_dict1 = {'topic_id': 2, 'subject_id': 41, 'topic_type_id': 20, 'content': '点$A\\left(-3,4\\right)$所在象限为( )', 'options': ['第一象限', '第二象限', '第三象限', '第四象限']}
  191. chachong_item_dict2 = {'topic_id': 2, 'subject_id': 41, 'topic_type_id': 20,
  192. 'content': '<p>点<img src=\"http://10.19.1.7:11088/ser_static/26693/files/image8.png\" style=\"width: 43.2pt; height: 14.4pt\" data-type=\"math\" data-latex=\"$A( - 3,4)$\" width=\"58\" height=\"19\" />所在象限为( )</p>',
  193. 'options': ['<p>第一象限</p>', '<p>第二象限</p>', '<p>第三象限</p', '<p>第四象限</p>']}
  194. chachong_item_dict3 = {'topic_id': 2, 'subject_id': 41, 'topic_type_id': 20,
  195. 'content': '点<img src=\"http://zxhx-pro-1302712961.cos.ap-beijing.myqcloud.com/zyk/uploadfiles/wording/62afe8286c6aff2279345f13/MJMATH-1655780770452801.png\" width=\"57.0\" height=\"17.5\" data-type=\"math\" data-latex=\"$A\\left(-3,4\\right)$\" />所在象限为( )',
  196. 'options': ['第一象限', '第二象限', '第三象限', '第四象限']}
  197. import configs
  198. # repeat_ip = "http://82.156.68.22:8888/api/repeat/subject" 保存入库查重
  199. repeat_ip = "http://82.156.68.22:8888/repeat/subject" # 全学科查重
  200. # repeat_r = requests.post(url=configs.repeat_ip, json={"topics":[chachong_item_dict2],
  201. # "callback":"http://192.168.1.140:8888/kk"})
  202. # repeat_r = requests.post(url=configs.repeat_ip, json=[chachong_item_dict1])
  203. # print(repeat_r.content)
  204. import os
  205. print(os.environ.get('APPDATA'))