{"id":85,"date":"2021-12-18T19:50:19","date_gmt":"2021-12-18T11:50:19","guid":{"rendered":"https:\/\/lmceric.top\/?p=85"},"modified":"2021-12-18T19:51:38","modified_gmt":"2021-12-18T11:51:38","slug":"python%e8%b0%83%e7%94%a8%e7%99%be%e5%ba%a6%e4%ba%91%e6%96%87%e5%ad%97%e8%af%86%e5%88%ab","status":"publish","type":"post","link":"https:\/\/lmceric.top\/index.php\/2021\/12\/18\/85\/","title":{"rendered":"python\u8c03\u7528\u767e\u5ea6\u4e91\u6587\u5b57\u8bc6\u522b"},"content":{"rendered":"\n<p>\u524d\u6bb5\u65f6\u95f4\u4e86\u89e3\u5230\u767e\u5ea6\u4e91\u6bcf\u4e2a\u6708\u6709\u514d\u8d39\u76841000\u6b21\u6587\u5b57\u8bc6\u522b\uff08OCR\uff09\u7684\u63a5\u53e3\uff0c\u9a6c\u4e0a\u5c31\u53bb\u56f4\u89c2\u9886\u53d6\u4e86\u3002\u8fd9\u91cc\u8bb0\u5f55\u4e00\u4e0b\u6211\u7b2c\u4e00\u6b21\u4f7f\u7528\u767e\u5ea6\u667a\u80fd\u4e91\u7684OCR API\u7684\u8fc7\u7a0b<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. \u5149\u5b66\u6587\u5b57\u8bc6\u522b<\/h2>\n\n\n\n<p>OCR \uff08Optical Character Recognition\uff0c\u5149\u5b66\u5b57\u7b26\u8bc6\u522b\uff09\u662f\u6307\u7535\u5b50\u8bbe\u5907\uff08\u4f8b\u5982\u626b\u63cf\u4eea\u6216\u6570\u7801\u76f8\u673a\uff09\u68c0\u67e5\u7eb8\u4e0a\u6253\u5370\u7684\u5b57\u7b26\uff0c\u901a\u8fc7\u68c0\u6d4b\u6697\u3001\u4eae\u7684\u6a21\u5f0f\u786e\u5b9a\u5176\u5f62\u72b6\uff0c\u7136\u540e\u7528\u5b57\u7b26\u8bc6\u522b\u65b9\u6cd5\u5c06\u5f62\u72b6\u7ffb\u8bd1\u6210\u8ba1\u7b97\u673a\u6587\u5b57\u7684\u8fc7\u7a0b\uff1b\u5373\uff0c\u9488\u5bf9\u5370\u5237\u4f53\u5b57\u7b26\uff0c\u91c7\u7528\u5149\u5b66\u7684\u65b9\u5f0f\u5c06\u7eb8\u8d28\u6587\u6863\u4e2d\u7684\u6587\u5b57\u8f6c\u6362\u6210\u4e3a\u9ed1\u767d\u70b9\u9635\u7684\u56fe\u50cf\u6587\u4ef6\uff0c\u5e76\u901a\u8fc7\u8bc6\u522b\u8f6f\u4ef6\u5c06\u56fe\u50cf\u4e2d\u7684\u6587\u5b57\u8f6c\u6362\u6210\u6587\u672c\u683c\u5f0f\uff0c\u4f9b\u6587\u5b57\u5904\u7406\u8f6f\u4ef6\u8fdb\u4e00\u6b65\u7f16\u8f91\u52a0\u5de5\u7684\u6280\u672f\u3002\u5982\u4f55\u9664\u9519\u6216\u5229\u7528\u8f85\u52a9\u4fe1\u606f\u63d0\u9ad8\u8bc6\u522b\u6b63\u786e\u7387\uff0c\u662fOCR\u6700\u91cd\u8981\u7684\u8bfe\u9898\uff0cICR\uff08Intelligent Character Recognition\uff09\u7684\u540d\u8bcd\u4e5f\u56e0\u6b64\u800c\u4ea7\u751f\u3002\u8861\u91cf\u4e00\u4e2aOCR\u7cfb\u7edf\u6027\u80fd\u597d\u574f\u7684\u4e3b\u8981\u6307\u6807\u6709\uff1a\u62d2\u8bc6\u7387\u3001\u8bef\u8bc6\u7387\u3001\u8bc6\u522b\u901f\u5ea6\u3001\u7528\u6237\u754c\u9762\u7684\u53cb\u597d\u6027\uff0c\u4ea7\u54c1\u7684\u7a33\u5b9a\u6027\uff0c\u6613\u7528\u6027\u53ca\u53ef\u884c\u6027\u7b49\u3002<\/p>\n\n\n\n<p><em>PS\uff1a\u4e0a\u9762\u662f\u6211\u4ece\u767e\u5ea6ctrl C V\u590d\u5236\u6765\u7684\uff0c\u6539\u5929\u6211\u53e6\u5199\u4e00\u7bc7\u4e13\u95e8\u4ecb\u7ecd\u6587\u5b57\u8bc6\u522b\u7684\u535a\u5ba223333\uff08<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2. \u4e3a\u4ec0\u4e48\u8981\u7528API<\/h2>\n\n\n\n<p>\u4e4b\u524d\u6211\u4e00\u76f4\u6709\u4e00\u4e2a\u7591\u60d1\uff0c\u4e3a\u4ec0\u4e48\u6709\u5f00\u6e90\u7684\u5e93\u6216\u8005\u6a21\u578b\uff0c\u4ecd\u7136\u6709\u8fd9\u79cdAPI\u8c03\u7528\u7684\u89e3\u51b3\u65b9\u6848\u5b58\u5728\uff1f<\/p>\n\n\n\n<p>\u8fd9\u91cc\u6211\u53ef\u4ee5\u4e3a\u4f60\u8be6\u7ec6\u89e3\u91ca\u4e00\u4e0b<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2.1 API<\/h3>\n\n\n\n<p>API\uff08Application Programming Interface\uff0c\u5e94\u7528\u7a0b\u5e8f\u63a5\u53e3\uff09\u662f\u4e00\u4e9b\u9884\u5148\u5b9a\u4e49\u7684\u63a5\u53e3\uff08\u5982\u51fd\u6570\u3001HTTP\u63a5\u53e3\uff09\uff0c\u6216\u6307\u8f6f\u4ef6\u7cfb\u7edf\u4e0d\u540c\u7ec4\u6210\u90e8\u5206\u8854\u63a5\u7684\u7ea6\u5b9a\u3002\u7528\u6765\u63d0\u4f9b\u5e94\u7528\u7a0b\u5e8f\u4e0e\u5f00\u53d1\u4eba\u5458\u57fa\u4e8e\u67d0\u8f6f\u4ef6\u6216\u786c\u4ef6\u5f97\u4ee5\u8bbf\u95ee\u7684\u4e00\u7ec4\u4f8b\u7a0b\uff0c\u800c\u53c8\u65e0\u9700\u8bbf\u95ee\u6e90\u7801\uff0c\u6216\u7406\u89e3\u5185\u90e8\u5de5\u4f5c\u673a\u5236\u7684\u7ec6\u8282\u3002<\/p>\n\n\n\n<p>\u57fa\u4e8e\u4e92\u8054\u7f51\u7684\u5e94\u7528\u6b63\u53d8\u5f97\u8d8a\u6765\u8d8a\u666e\u53ca\uff0c\u5728\u8fd9\u4e2a\u8fc7\u7a0b\u4e2d\uff0c\u6709\u66f4\u591a\u7684\u7ad9\u70b9\u5c06\u81ea\u8eab\u7684\u8d44\u6e90\u5f00\u653e\u7ed9\u5f00\u53d1\u8005\u6765\u8c03\u7528\u3002\u5bf9\u5916\u63d0\u4f9b\u7684API \u8c03\u7528\u4f7f\u5f97\u7ad9\u70b9\u4e4b\u95f4\u7684\u5185\u5bb9\u5173\u8054\u6027\u66f4\u5f3a\uff0c\u540c\u65f6\u8fd9\u4e9b\u5f00\u653e\u7684\u5e73\u53f0\u4e5f\u4e3a\u7528\u6237\u3001\u5f00\u53d1\u8005\u548c\u4e2d\u5c0f\u7f51\u7ad9\u5e26\u6765\u4e86\u66f4\u5927\u7684\u4ef7\u503c\u3002<br>\u5f00\u653e\u662f\u53d1\u5c55\u8d8b\u52bf\uff0c\u8d8a\u6765\u8d8a\u591a\u7684\u4ea7\u54c1\u8d70\u5411\u5f00\u653e\u3002\u7f51\u7ad9\u4e0d\u80fd\u9760\u9650\u5236\u7528\u6237\u79bb\u5f00\u6765\u7559\u4f4f\u7528\u6237\uff0c\u5f00\u653e\u7684\u67b6\u6784\u53cd\u800c\u66f4\u589e\u52a0\u4e86\u7528\u6237\u7684\u7c98\u6027\u3002\u5728Web 2.0\u7684\u6d6a\u6f6e\u5230\u6765\u4e4b\u524d\uff0c\u5f00\u653e\u7684API \u751a\u81f3\u6e90\u4ee3\u7801\u4e3b\u8981\u4f53\u73b0\u5728\u684c\u9762\u5e94\u7528\u4e0a\uff0c\u8d8a\u6765\u8d8a\u591a\u7684Web\u5e94\u7528\u9762\u5411\u5f00\u53d1\u8005\u5f00\u653e\u4e86API\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2.2 API\u7684\u4f18\u52bf<\/h3>\n\n\n\n<p>API\u5f00\u53d1\u6210\u672c\u4f4e\uff0c\u5bf9\u63a5\u6bd4\u8f83\u7b80\u5355\uff0c\u53ef\u4ee5\u5feb\u901f\u9a8c\u8bc1\u5546\u4e1a\u6a21\u5f0f\u548c\u7528\u6237\u4f53\u9a8c\u3002<\/p>\n\n\n\n<p>\u8bf4\u767d\u4e86\uff0c\u5c31\u662fAPI\u66f4\u65b9\u4fbf\u4e14\u8f7b\u91cf\u5316\uff0c\u5c24\u5176\u662f\u5728\u4e00\u4e9b\u7b97\u529b\u8f83\u4f4e\u7684\u5d4c\u5165\u5f0f\u8bbe\u5907\u4e0a\u3002\u5982\u679c\u52a8\u7528\u672c\u5730\u7684\u8fd0\u7b97\uff0c\u65f6\u95f4\u6210\u672c\u4f1a\u975e\u5e38\u5e9e\u5927\uff1b\u800c\u76f8\u53cd\uff0cAPI\u80fd\u591f\u5229\u7528\u4e92\u8054\u7f51\u4e0a\u7684\u9ad8\u7b97\u529b\u8bbe\u5907\u5feb\u901f\u8fd0\u7b97\uff0c\u4f18\u5316\u7528\u6237\u4f53\u9a8c\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3. \u4ece\u70b9\u5f00\u767e\u5ea6\u4e91\u5b98\u7f51\u5f00\u59cb<\/h2>\n\n\n\n<p>\u6211\u76f4\u63a5\u53ea\u63a5\u89e6\u8fc7\u817e\u8baf\u4e91\u548c\u963f\u91cc\u4e91\u5e73\u53f0<del>\u5bf9\u4e8e\u767e\u5ea6\u667a\u80fd\u4e91\u7684\u4e86\u89e3\u4ec5\u9650\u4e8e\u7f51\u76d8<\/del>\uff0c\u4e0d\u592a\u4e86\u89e3\u767e\u5ea6\u4e91\u7684\u6d41\u7a0b\u3002<\/p>\n\n\n\n<p>\u70b9\u5f00<a href=\"https:\/\/cloud.baidu.com\/\">\u767e\u5ea6\u667a\u80fd\u4e91\u9996\u9875<\/a> \u70b9\u51fb\u4e0a\u65b9[\u4ea7\u54c1]\uff0c\u627e\u5230[\u4eba\u5de5\u667a\u80fd]\uff0c\u5728\u8be5\u677f\u5757\u5185\u627e\u5230[OCR\u6587\u5b57\u8bc6\u522b]-[<a href=\"https:\/\/cloud.baidu.com\/product\/ocr_general\">\u901a\u7528\u573a\u666f\u6587\u5b57\u8bc6\u522b<\/a>]<\/p>\n\n\n\n<p>\u6ce8\u518c\u5b8c\u6210\u540e\u4f1a\u6709\u6bcf\u6708500\u6b21\u7684\u4f53\u9a8c\uff0c\u5b9e\u540d\u8ba4\u8bc1\u540e\u4f1a\u67091000\u6b21\u7684\u4f53\u9a8c\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3.1 \u521b\u5efa\u5e94\u7528<\/h3>\n\n\n\n<p>\u5728\u63a7\u5236\u53f0\u627e\u5230\u6587\u5b57\u8bc6\u522b\uff0c\u5728\u201c\u5e94\u7528\u201d\u5904\u70b9\u51fb\u201c\u521b\u5efa\u5e94\u7528\u201d\uff0c\u5982\u4e0b\u56fe\u6240\u793a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"489\" src=\"https:\/\/lmceric.top\/wp-content\/uploads\/2021\/12\/image-20211218192943104-1024x489.png\" alt=\"\" class=\"wp-image-87\" srcset=\"https:\/\/lmceric.top\/wp-content\/uploads\/2021\/12\/image-20211218192943104-1024x489.png 1024w, https:\/\/lmceric.top\/wp-content\/uploads\/2021\/12\/image-20211218192943104-300x143.png 300w, https:\/\/lmceric.top\/wp-content\/uploads\/2021\/12\/image-20211218192943104-768x367.png 768w, https:\/\/lmceric.top\/wp-content\/uploads\/2021\/12\/image-20211218192943104.png 1304w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u9009\u62e9\u201c\u4e2a\u4eba\u201d<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"797\" height=\"358\" src=\"https:\/\/lmceric.top\/wp-content\/uploads\/2021\/12\/image-20211218193020623.png\" alt=\"\" class=\"wp-image-88\" srcset=\"https:\/\/lmceric.top\/wp-content\/uploads\/2021\/12\/image-20211218193020623.png 797w, https:\/\/lmceric.top\/wp-content\/uploads\/2021\/12\/image-20211218193020623-300x135.png 300w, https:\/\/lmceric.top\/wp-content\/uploads\/2021\/12\/image-20211218193020623-768x345.png 768w\" sizes=\"auto, (max-width: 797px) 100vw, 797px\" \/><\/figure>\n\n\n\n<p>\u70b9\u51fb\u201c\u7acb\u5373\u521b\u5efa\u201d\uff0c\u5e94\u7528\u5c31\u521b\u5efa\u597d\u4e86\u3002<\/p>\n\n\n\n<p>\u5728[\u5e94\u7528\u5217\u8868]\u5904\u4f1a\u6709\u5e94\u7528\u5217\u8868\uff0c\u5728\u5bf9\u5e94\u5e94\u7528\u5904\u6709API Key\u548cSecret Key\uff0c\u8bf7\u4fdd\u5b58\u597d\u79d8\u94a5\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"355\" src=\"https:\/\/lmceric.top\/wp-content\/uploads\/2021\/12\/image-20211218193310997-1024x355.png\" alt=\"\" class=\"wp-image-89\" srcset=\"https:\/\/lmceric.top\/wp-content\/uploads\/2021\/12\/image-20211218193310997-1024x355.png 1024w, https:\/\/lmceric.top\/wp-content\/uploads\/2021\/12\/image-20211218193310997-300x104.png 300w, https:\/\/lmceric.top\/wp-content\/uploads\/2021\/12\/image-20211218193310997-768x267.png 768w, https:\/\/lmceric.top\/wp-content\/uploads\/2021\/12\/image-20211218193310997.png 1305w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">3.2 \u521b\u5efapython\u9879\u76ee<\/h3>\n\n\n\n<p>\u867d\u7136python\u53ef\u4ee5\u76f4\u63a5\u7528\u8bb0\u4e8b\u672c\u5199\uff0c\u4f46\u662f\u4e00\u4e2a\u597d\u7684IDE\u771f\u7684\u4f1a\u4f7f\u4eba\u5fc3\u60c5\u6109\u60a6\uff0c\u4e0d\u5fc5\u4e3a\u7b49\u53f7\u4e24\u8fb9\u7684\u7a7a\u683c\u800c\u70e6\u607c\u3002<\/p>\n\n\n\n<p>\u8fd9\u91cc\u6211\u4f7f\u7528\u7684\u662fpycharm\u3002<\/p>\n\n\n\n<p>\u65b0\u5efa\u4e00\u4e2a\u9879\u76ee\uff0c\u521b\u5efamain.py\u6b22\u8fce\u811a\u672c\uff0c\u5728\u9879\u76ee\u6839\u76ee\u5f55\u65b0\u5efa\u76ee\u5f55\u201cimg&#8221;<\/p>\n\n\n\n<p>\u653e\u5165\u56fe\u7247\u5230\u65b0\u5efa\u7684img\u6587\u4ef6\u5939\u5185<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3.3 \u8d34\u5165\u4ee3\u7801\uff0c\u8fd0\u884c\u8c03\u8bd5<\/h3>\n\n\n\n<p>\u590d\u5236\u4e0b\u5217\u4ee3\u7801\u66ff\u6362\u6389main.py\u4e2d\u5df2\u6709\u7684\u4ee3\u7801<\/p>\n\n\n\n<p>\u8bf7\u6ce8\u610f\u66ff\u6362\u4ee3\u7801\u4e2d\u7684<strong>API_KEY<\/strong> \u4ee5\u53ca <strong>SECRET_KEY<\/strong>\uff0c\u83b7\u53d6\u4f4d\u7f6e\u5c31\u662f\u4e0a\u6587\u63d0\u5230\u7684\u5e94\u7528\u5217\u8868\u5904\uff0c\u5e76\u5c06\u56fe\u7247\u7684\u540d\u79f0\u548c\u76ee\u5f55\u6539\u4e3a\u4f60\u6d4b\u8bd5\u7528\u7684\u56fe\u7247\u53ca\u76ee\u5f55<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># coding=utf-8\n\nimport sys\nimport json\nimport base64\n\n\n# \u4fdd\u8bc1\u517c\u5bb9python2\u4ee5\u53capython3\nIS_PY3 = sys.version_info.major == 3\nif IS_PY3:\n    from urllib.request import urlopen\n    from urllib.request import Request\n    from urllib.error import URLError\n    from urllib.parse import urlencode\n    from urllib.parse import quote_plus\nelse:\n    import urllib2\n    from urllib import quote_plus\n    from urllib2 import urlopen\n    from urllib2 import Request\n    from urllib2 import URLError\n    from urllib import urlencode\n\n# \u9632\u6b62https\u8bc1\u4e66\u6821\u9a8c\u4e0d\u6b63\u786e\nimport ssl\nssl._create_default_https_context = ssl._create_unverified_context\n\nAPI_KEY = 'GmhC18eVP1Fo1ECX911dtOzw'\n\nSECRET_KEY = 'PQ2ukO4Aec2PTsgQU9UkiEKYciavlZk8'\n\n\nOCR_URL = \"https:\/\/aip.baidubce.com\/rest\/2.0\/ocr\/v1\/accurate_basic\"\n\n\n\"\"\"  TOKEN start \"\"\"\nTOKEN_URL = 'https:\/\/aip.baidubce.com\/oauth\/2.0\/token'\n\n\n\"\"\"\n    \u83b7\u53d6token\n\"\"\"\ndef fetch_token():\n    params = {'grant_type': 'client_credentials',\n              'client_id': API_KEY,\n              'client_secret': SECRET_KEY}\n    post_data = urlencode(params)\n    if (IS_PY3):\n        post_data = post_data.encode('utf-8')\n    req = Request(TOKEN_URL, post_data)\n    try:\n        f = urlopen(req, timeout=5)\n        result_str = f.read()\n    except URLError as err:\n        print(err)\n    if (IS_PY3):\n        result_str = result_str.decode()\n\n\n    result = json.loads(result_str)\n\n    if ('access_token' in result.keys() and 'scope' in result.keys()):\n        if not 'brain_all_scope' in result&#91;'scope'].split(' '):\n            print ('please ensure has check the  ability')\n            exit()\n        return result&#91;'access_token']\n    else:\n        print ('please overwrite the correct API_KEY and SECRET_KEY')\n        exit()\n\n\"\"\"\n    \u8bfb\u53d6\u6587\u4ef6\n\"\"\"\ndef read_file(image_path):\n    f = None\n    try:\n        f = open(image_path, 'rb')\n        return f.read()\n    except:\n        print('read image file fail')\n        return None\n    finally:\n        if f:\n            f.close()\n\n\n\"\"\"\n    \u8c03\u7528\u8fdc\u7a0b\u670d\u52a1\n\"\"\"\ndef request(url, data):\n    req = Request(url, data.encode('utf-8'))\n    has_error = False\n    try:\n        f = urlopen(req)\n        result_str = f.read()\n        if (IS_PY3):\n            result_str = result_str.decode()\n        return result_str\n    except  URLError as err:\n        print(err)\n\nif __name__ == '__main__':\n\n    # \u83b7\u53d6access token\n    token = fetch_token()\n\n    # \u62fc\u63a5\u901a\u7528\u6587\u5b57\u8bc6\u522b\u9ad8\u7cbe\u5ea6url\n    image_url = OCR_URL + \"?access_token=\" + token\n\n    text = \"\"\n\n    # \u8bfb\u53d6\u6d4b\u8bd5\u56fe\u7247\n    file_content = read_file('img\/test.jpg')\n\n    # \u8c03\u7528\u6587\u5b57\u8bc6\u522b\u670d\u52a1\n    result = request(image_url, urlencode({'image': base64.b64encode(file_content)}))\n\n    # \u89e3\u6790\u8fd4\u56de\u7ed3\u679c\n    result_json = json.loads(result)\n    for words_result in result_json&#91;\"words_result\"]:\n        text = text + words_result&#91;\"words\"]\n\n    # \u6253\u5370\u6587\u5b57\n    print(text)<\/code><\/pre>\n\n\n\n<p>\u5728\u547d\u4ee4\u884c\u4e2d\u8fd0\u884c<code>python main.py<\/code><\/p>\n\n\n\n<p>\u8fd0\u884c\u540e\u63a7\u5236\u53f0\u4f1a\u6709\u4e0b\u5217\u8f93\u51fa\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"780\" height=\"282\" src=\"https:\/\/lmceric.top\/wp-content\/uploads\/2021\/12\/image-20211218194519408.png\" alt=\"\" class=\"wp-image-90\" srcset=\"https:\/\/lmceric.top\/wp-content\/uploads\/2021\/12\/image-20211218194519408.png 780w, https:\/\/lmceric.top\/wp-content\/uploads\/2021\/12\/image-20211218194519408-300x108.png 300w, https:\/\/lmceric.top\/wp-content\/uploads\/2021\/12\/image-20211218194519408-768x278.png 768w\" sizes=\"auto, (max-width: 780px) 100vw, 780px\" \/><\/figure>\n\n\n\n<p>\u6211\u8bc6\u522b\u7684\u662f\u7f51\u4e0a\u968f\u4fbf\u627e\u7684\u4e00\u4e2a\u8def\u724c\u7684\u5e7f\u544a\uff08<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u6bb5\u65f6\u95f4\u4e86\u89e3\u5230\u767e\u5ea6\u4e91\u6bcf\u4e2a\u6708\u6709\u514d\u8d39\u76841000\u6b21\u6587\u5b57\u8bc6&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/lmceric.top\/index.php\/2021\/12\/18\/85\/\">Continue reading<span class=\"screen-reader-text\">python\u8c03\u7528\u767e\u5ea6\u4e91\u6587\u5b57\u8bc6\u522b<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":92,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","footnotes":""},"categories":[11],"tags":[27,6,25,26],"class_list":["post-85","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tec","tag-python","tag-6","tag-25","tag-26","entry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>python\u8c03\u7528\u767e\u5ea6\u4e91\u6587\u5b57\u8bc6\u522b - LMC\u7684\u4e2a\u4eba\u7ad9<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/lmceric.top\/index.php\/2021\/12\/18\/85\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"python\u8c03\u7528\u767e\u5ea6\u4e91\u6587\u5b57\u8bc6\u522b - LMC\u7684\u4e2a\u4eba\u7ad9\" \/>\n<meta property=\"og:description\" content=\"\u524d\u6bb5\u65f6\u95f4\u4e86\u89e3\u5230\u767e\u5ea6\u4e91\u6bcf\u4e2a\u6708\u6709\u514d\u8d39\u76841000\u6b21\u6587\u5b57\u8bc6&#8230;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/lmceric.top\/index.php\/2021\/12\/18\/85\/\" \/>\n<meta property=\"og:site_name\" content=\"LMC\u7684\u4e2a\u4eba\u7ad9\" \/>\n<meta property=\"article:published_time\" content=\"2021-12-18T11:50:19+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-12-18T11:51:38+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/lmceric.top\/wp-content\/uploads\/2021\/12\/OIP-C.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"474\" \/>\n\t<meta property=\"og:image:height\" content=\"266\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"SimpleAstronaut\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"SimpleAstronaut\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/lmceric.top\\\/index.php\\\/2021\\\/12\\\/18\\\/85\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/lmceric.top\\\/index.php\\\/2021\\\/12\\\/18\\\/85\\\/\"},\"author\":{\"name\":\"SimpleAstronaut\",\"@id\":\"https:\\\/\\\/lmceric.top\\\/#\\\/schema\\\/person\\\/1edca9cfe5ff17dbe947c332a66ee539\"},\"headline\":\"python\u8c03\u7528\u767e\u5ea6\u4e91\u6587\u5b57\u8bc6\u522b\",\"datePublished\":\"2021-12-18T11:50:19+00:00\",\"dateModified\":\"2021-12-18T11:51:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/lmceric.top\\\/index.php\\\/2021\\\/12\\\/18\\\/85\\\/\"},\"wordCount\":55,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/lmceric.top\\\/index.php\\\/2021\\\/12\\\/18\\\/85\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/lmceric.top\\\/wp-content\\\/uploads\\\/2021\\\/12\\\/OIP-C.jpg\",\"keywords\":[\"python\",\"\u4e92\u8054\u7f51\",\"\u4eba\u5de5\u667a\u80fd\",\"\u56fe\u50cf\u8bc6\u522b\"],\"articleSection\":[\"\u6280\u672f\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/lmceric.top\\\/index.php\\\/2021\\\/12\\\/18\\\/85\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/lmceric.top\\\/index.php\\\/2021\\\/12\\\/18\\\/85\\\/\",\"url\":\"https:\\\/\\\/lmceric.top\\\/index.php\\\/2021\\\/12\\\/18\\\/85\\\/\",\"name\":\"python\u8c03\u7528\u767e\u5ea6\u4e91\u6587\u5b57\u8bc6\u522b - LMC\u7684\u4e2a\u4eba\u7ad9\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/lmceric.top\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/lmceric.top\\\/index.php\\\/2021\\\/12\\\/18\\\/85\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/lmceric.top\\\/index.php\\\/2021\\\/12\\\/18\\\/85\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/lmceric.top\\\/wp-content\\\/uploads\\\/2021\\\/12\\\/OIP-C.jpg\",\"datePublished\":\"2021-12-18T11:50:19+00:00\",\"dateModified\":\"2021-12-18T11:51:38+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/lmceric.top\\\/#\\\/schema\\\/person\\\/1edca9cfe5ff17dbe947c332a66ee539\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/lmceric.top\\\/index.php\\\/2021\\\/12\\\/18\\\/85\\\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/lmceric.top\\\/index.php\\\/2021\\\/12\\\/18\\\/85\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\\\/\\\/lmceric.top\\\/index.php\\\/2021\\\/12\\\/18\\\/85\\\/#primaryimage\",\"url\":\"https:\\\/\\\/lmceric.top\\\/wp-content\\\/uploads\\\/2021\\\/12\\\/OIP-C.jpg\",\"contentUrl\":\"https:\\\/\\\/lmceric.top\\\/wp-content\\\/uploads\\\/2021\\\/12\\\/OIP-C.jpg\",\"width\":474,\"height\":266},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/lmceric.top\\\/index.php\\\/2021\\\/12\\\/18\\\/85\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\\\/\\\/lmceric.top\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"python\u8c03\u7528\u767e\u5ea6\u4e91\u6587\u5b57\u8bc6\u522b\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/lmceric.top\\\/#website\",\"url\":\"https:\\\/\\\/lmceric.top\\\/\",\"name\":\"LMC\u7684\u4e2a\u4eba\u7ad9\",\"description\":\"\u5b64\u5e06\u8fdc\u5f71\u78a7\u7a7a\u5c3d\uff0c\u552f\u89c1\u957f\u6c5f\u5929\u9645\u6d41\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/lmceric.top\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/lmceric.top\\\/#\\\/schema\\\/person\\\/1edca9cfe5ff17dbe947c332a66ee539\",\"name\":\"SimpleAstronaut\",\"sameAs\":[\"http:\\\/\\\/lmceric.top\"],\"url\":\"https:\\\/\\\/lmceric.top\\\/index.php\\\/author\\\/simpleastronaut\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"python\u8c03\u7528\u767e\u5ea6\u4e91\u6587\u5b57\u8bc6\u522b - LMC\u7684\u4e2a\u4eba\u7ad9","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/lmceric.top\/index.php\/2021\/12\/18\/85\/","og_locale":"zh_CN","og_type":"article","og_title":"python\u8c03\u7528\u767e\u5ea6\u4e91\u6587\u5b57\u8bc6\u522b - LMC\u7684\u4e2a\u4eba\u7ad9","og_description":"\u524d\u6bb5\u65f6\u95f4\u4e86\u89e3\u5230\u767e\u5ea6\u4e91\u6bcf\u4e2a\u6708\u6709\u514d\u8d39\u76841000\u6b21\u6587\u5b57\u8bc6&#8230;","og_url":"https:\/\/lmceric.top\/index.php\/2021\/12\/18\/85\/","og_site_name":"LMC\u7684\u4e2a\u4eba\u7ad9","article_published_time":"2021-12-18T11:50:19+00:00","article_modified_time":"2021-12-18T11:51:38+00:00","og_image":[{"width":474,"height":266,"url":"https:\/\/lmceric.top\/wp-content\/uploads\/2021\/12\/OIP-C.jpg","type":"image\/jpeg"}],"author":"SimpleAstronaut","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"SimpleAstronaut","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/lmceric.top\/index.php\/2021\/12\/18\/85\/#article","isPartOf":{"@id":"https:\/\/lmceric.top\/index.php\/2021\/12\/18\/85\/"},"author":{"name":"SimpleAstronaut","@id":"https:\/\/lmceric.top\/#\/schema\/person\/1edca9cfe5ff17dbe947c332a66ee539"},"headline":"python\u8c03\u7528\u767e\u5ea6\u4e91\u6587\u5b57\u8bc6\u522b","datePublished":"2021-12-18T11:50:19+00:00","dateModified":"2021-12-18T11:51:38+00:00","mainEntityOfPage":{"@id":"https:\/\/lmceric.top\/index.php\/2021\/12\/18\/85\/"},"wordCount":55,"commentCount":0,"image":{"@id":"https:\/\/lmceric.top\/index.php\/2021\/12\/18\/85\/#primaryimage"},"thumbnailUrl":"https:\/\/lmceric.top\/wp-content\/uploads\/2021\/12\/OIP-C.jpg","keywords":["python","\u4e92\u8054\u7f51","\u4eba\u5de5\u667a\u80fd","\u56fe\u50cf\u8bc6\u522b"],"articleSection":["\u6280\u672f"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/lmceric.top\/index.php\/2021\/12\/18\/85\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/lmceric.top\/index.php\/2021\/12\/18\/85\/","url":"https:\/\/lmceric.top\/index.php\/2021\/12\/18\/85\/","name":"python\u8c03\u7528\u767e\u5ea6\u4e91\u6587\u5b57\u8bc6\u522b - LMC\u7684\u4e2a\u4eba\u7ad9","isPartOf":{"@id":"https:\/\/lmceric.top\/#website"},"primaryImageOfPage":{"@id":"https:\/\/lmceric.top\/index.php\/2021\/12\/18\/85\/#primaryimage"},"image":{"@id":"https:\/\/lmceric.top\/index.php\/2021\/12\/18\/85\/#primaryimage"},"thumbnailUrl":"https:\/\/lmceric.top\/wp-content\/uploads\/2021\/12\/OIP-C.jpg","datePublished":"2021-12-18T11:50:19+00:00","dateModified":"2021-12-18T11:51:38+00:00","author":{"@id":"https:\/\/lmceric.top\/#\/schema\/person\/1edca9cfe5ff17dbe947c332a66ee539"},"breadcrumb":{"@id":"https:\/\/lmceric.top\/index.php\/2021\/12\/18\/85\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/lmceric.top\/index.php\/2021\/12\/18\/85\/"]}]},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/lmceric.top\/index.php\/2021\/12\/18\/85\/#primaryimage","url":"https:\/\/lmceric.top\/wp-content\/uploads\/2021\/12\/OIP-C.jpg","contentUrl":"https:\/\/lmceric.top\/wp-content\/uploads\/2021\/12\/OIP-C.jpg","width":474,"height":266},{"@type":"BreadcrumbList","@id":"https:\/\/lmceric.top\/index.php\/2021\/12\/18\/85\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/lmceric.top\/"},{"@type":"ListItem","position":2,"name":"python\u8c03\u7528\u767e\u5ea6\u4e91\u6587\u5b57\u8bc6\u522b"}]},{"@type":"WebSite","@id":"https:\/\/lmceric.top\/#website","url":"https:\/\/lmceric.top\/","name":"LMC\u7684\u4e2a\u4eba\u7ad9","description":"\u5b64\u5e06\u8fdc\u5f71\u78a7\u7a7a\u5c3d\uff0c\u552f\u89c1\u957f\u6c5f\u5929\u9645\u6d41","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/lmceric.top\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/lmceric.top\/#\/schema\/person\/1edca9cfe5ff17dbe947c332a66ee539","name":"SimpleAstronaut","sameAs":["http:\/\/lmceric.top"],"url":"https:\/\/lmceric.top\/index.php\/author\/simpleastronaut\/"}]}},"jetpack_featured_media_url":"https:\/\/lmceric.top\/wp-content\/uploads\/2021\/12\/OIP-C.jpg","_links":{"self":[{"href":"https:\/\/lmceric.top\/index.php\/wp-json\/wp\/v2\/posts\/85","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lmceric.top\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lmceric.top\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lmceric.top\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lmceric.top\/index.php\/wp-json\/wp\/v2\/comments?post=85"}],"version-history":[{"count":1,"href":"https:\/\/lmceric.top\/index.php\/wp-json\/wp\/v2\/posts\/85\/revisions"}],"predecessor-version":[{"id":91,"href":"https:\/\/lmceric.top\/index.php\/wp-json\/wp\/v2\/posts\/85\/revisions\/91"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lmceric.top\/index.php\/wp-json\/wp\/v2\/media\/92"}],"wp:attachment":[{"href":"https:\/\/lmceric.top\/index.php\/wp-json\/wp\/v2\/media?parent=85"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lmceric.top\/index.php\/wp-json\/wp\/v2\/categories?post=85"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lmceric.top\/index.php\/wp-json\/wp\/v2\/tags?post=85"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}