{"id":1156,"date":"2026-07-12T12:25:08","date_gmt":"2026-07-12T12:25:08","guid":{"rendered":"https:\/\/blog.nimail.cn\/?p=1156"},"modified":"2026-07-12T12:25:08","modified_gmt":"2026-07-12T12:25:08","slug":"%e9%ab%98%e6%95%88%e5%9b%be%e7%89%87%e8%a3%81%e5%89%aa%e6%8c%87%e5%8d%97-%e5%9c%a8%e7%ba%bf%e5%b7%a5%e5%85%b7%e4%b8%8epython%e8%87%aa%e5%8a%a8%e5%8c%96%e5%ae%9e%e6%88%98","status":"publish","type":"post","link":"https:\/\/blog.nimail.cn\/best-articles\/%e9%ab%98%e6%95%88%e5%9b%be%e7%89%87%e8%a3%81%e5%89%aa%e6%8c%87%e5%8d%97-%e5%9c%a8%e7%ba%bf%e5%b7%a5%e5%85%b7%e4%b8%8epython%e8%87%aa%e5%8a%a8%e5%8c%96%e5%ae%9e%e6%88%98\/","title":{"rendered":"\u9ad8\u6548\u56fe\u7247\u88c1\u526a\u6307\u5357\uff1a\u5728\u7ebf\u5de5\u5177\u4e0ePython\u81ea\u52a8\u5316\u5b9e\u6218"},"content":{"rendered":"<h2 class=\"mt-4 mb-3 fw-bold text-dark\">\u544a\u522b\u7e41\u7410\u624b\u52a8\u64cd\u4f5c\uff0c\u5728\u7ebf\u5de5\u5177\u7684\u9ad8\u6548\u5b9e\u8df5<\/h2>\n<p class=\"mb-3 text-secondary\">\u65e5\u5e38\u505aUI\u7d20\u6750\u6216\u8005\u8fd0\u8425\u914d\u56fe\u65f6\uff0c<strong>\u5982\u4f55\u88c1\u526a\u56fe\u7247<\/strong>\u5f80\u5f80\u662f\u6700\u8017\u65f6\u7684\u73af\u8282\u3002\u4ee5\u524d\u603b\u7231\u6298\u817e\u672c\u5730<strong>\u56fe\u7247\u88c1\u526a\u8f6f\u4ef6<\/strong>\uff0c\u540e\u6765\u53d1\u73b0\u76f4\u63a5\u4e0a<strong>\u56fe\u7247\u88c1\u526a\u5728\u7ebf\u514d\u8d39<\/strong>\u7684\u65b9\u6848\u53cd\u800c\u66f4\u987a\u624b\u3002\u6700\u8fd1\u6211\u5728\u8dd1\u4e00\u4e2a\u7535\u5546\u9879\u76ee\uff0c\u6d4b\u8bd5\u4e86\u591a\u6b3e<strong>\u7167\u7247\u88c1\u526a\u5de5\u5177<\/strong>\uff0c\u6700\u540e\u628a<span class=\"text-primary\">https:\/\/www.nimail.cn\/img-tools\/image-cropper.html<\/span>\u52a0\u5165\u4e86\u65e5\u5e38\u5de5\u5177\u7bb1\u3002\u8fd9\u4e2a\u5e73\u53f0\u7684\u4ea4\u4e92\u903b\u8f91\u5f88\u7b26\u5408\u524d\u7aef\u5f00\u53d1\u8005\u7684\u4e60\u60ef\uff0c\u62d6\u62fd\u4e0a\u4f20\u540e\u7acb\u523b\u80fd\u770b\u5230<strong>\u539f\u56fe\u7247\u526a\u88c1\u9884\u89c8\u56fe<\/strong>\uff0c\u6ca1\u6709\u4efb\u4f55\u591a\u4f59\u7684\u52a0\u8f7d\u5ef6\u8fdf\u3002\u5e95\u5c42\u7684Canvas\u6e32\u67d3\u8ba9\u6bcf\u4e00\u6b21<strong>\u5728\u7ebf\u88c1\u526a<\/strong>\u90fd\u8ddf\u624b\uff0c\u62d6\u52a8\u63a7\u5236\u70b9\u65f6\u50cf\u7d20\u5bf9\u9f50\u975e\u5e38\u7cbe\u51c6\u3002<\/p>\n<div class=\"card shadow-sm mb-4 w-100\">\n<div class=\"card-body p-4\">\n<h3 class=\"card-title h5 fw-semibold mb-3\">\u6838\u5fc3\u4eae\u70b9\u62c6\u89e3<\/h3>\n<ul class=\"list-unstyled mb-0\">\n<li class=\"mb-2 d-flex align-items-start gap-2\"><span class=\"badge bg-success me-2 mt-1\">01<\/span>\n<div><strong>\u7075\u6d3b\u7684\u6bd4\u4f8b\u4e0e\u5f62\u72b6\u63a7\u5236<\/strong>\uff1a\u4e0d\u7ba1\u662f\u5e38\u89c4\u768416:9\u8fd8\u662f\u7279\u6b8a\u7684<strong>\u5706\u5f62\u56fe\u7247\u88c1\u526a<\/strong>\uff0c\u751a\u81f3\u9700\u8981<strong>\u56fe\u7247\u88c1\u526a\u6210\u4efb\u610f\u5f62\u72b6<\/strong>\u7684\u77e2\u91cf\u906e\u7f69\u9700\u6c42\uff0c\u5b83\u90fd\u80fd\u4e00\u952e\u641e\u5b9a\u3002\u5bf9\u4e8e\u9700\u8981\u505a\u5934\u50cf\u6216\u8005\u7279\u6b8a\u7248\u5f0f\u7684\u573a\u666f\uff0c<strong>\u56fe\u7247\u5206\u5272\u5668\u5728\u7ebf\u4f7f\u7528<\/strong>\u7684\u903b\u8f91\u975e\u5e38\u6e05\u6670\uff0c\u652f\u6301\u81ea\u7531\u7ed8\u5236\u8499\u7248\u3002<\/div>\n<\/li>\n<li class=\"mb-2 d-flex align-items-start gap-2\"><span class=\"badge bg-info me-2 mt-1\">02<\/span>\n<div><strong>\u8bc1\u4ef6\u7167\u4e0e\u6807\u51c6\u5316\u8f93\u51fa<\/strong>\uff1a\u5f88\u591a<strong>\u4e00\u5bf8\u7167\u7247\u88c1\u526a<\/strong>\u6559\u7a0b\u90fd\u5728\u8bb2\u600e\u4e48\u8c03\u53c2\u6570\uff0c\u4f46\u8fd9\u91cc\u5185\u7f6e\u4e86\u6807\u51c6\u5c3a\u5bf8\u6a21\u677f\u3002\u914d\u5408\u81ea\u5e26\u7684<strong>\u4e00\u5bf8\u7167\u7247\u5c3a\u5bf8\u751f\u6210\u5668<\/strong>\uff0c\u76f4\u63a5\u5bfc\u51fa\u5e26\u767d\u5e95\u7684JPG\uff0c\u7701\u53bb\u4e86\u540e\u671f\u5728Photoshop\u91cc\u62a0\u80cc\u666f\u7684\u529f\u592b\u3002\u8fd8\u652f\u6301\u81ea\u5b9a\u4e49\u80cc\u666f\u8272\uff0c\u9002\u5408HR\u6279\u91cf\u5904\u7406\u7b80\u5386\u7167\u3002<\/div>\n<\/li>\n<li class=\"d-flex align-items-start gap-2\"><span class=\"badge bg-warning text-dark me-2 mt-1\">03<\/span>\n<div><strong>\u6279\u91cf\u5904\u7406\u4e0d\u5361\u987f<\/strong>\uff1a\u9047\u5230\u51e0\u5341\u5f20\u4ea7\u54c1\u56fe\u9700\u8981\u7edf\u4e00\u89c4\u683c\u65f6\uff0c\u5b83\u7684<strong>\u56fe\u7247\u6279\u91cf\u88c1\u526a<\/strong>\u548c<strong>\u56fe\u7247\u5207\u5272<\/strong>\u529f\u80fd\u8868\u73b0\u7a33\u5b9a\u3002\u652f\u6301\u5e76\u53d1\u4e0a\u4f20\uff0c\u540e\u53f0\u6392\u961f\u6e32\u67d3\uff0c\u5b8c\u5168\u4e0d\u7528\u62c5\u5fc3\u5185\u5b58\u6ea2\u51fa\u3002\u5bf9\u4e8e\u9700\u8981\u9891\u7e41\u505a<strong>\u56fe\u7247\u5904\u7406<\/strong>\u7684\u8fd0\u8425\u56e2\u961f\u6765\u8bf4\uff0c\u8fd9\u7edd\u5bf9\u662f\u4e00\u4e2a\u80fd\u63d0\u534730%\u6548\u7387\u7684<strong>\u526a\u88c1\u5c0f\u5de5\u5177<\/strong>\u3002<\/div>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div class=\"alert alert-primary border-0 mb-4 w-100\"><strong>\ud83d\udca1 \u5f00\u53d1\u8005\u63d0\u793a\uff1a<\/strong>\u8be5\u5e73\u53f0\u5e95\u5c42\u91c7\u7528\u4e86WebAssembly\u52a0\u901f\u6280\u672f\uff0c\u6240\u6709<strong>\u5728\u7ebf\u5207\u56fe<\/strong>\u548c<strong>\u56fe\u7247\u88c1\u5207<\/strong>\u52a8\u4f5c\u5747\u5728\u6d4f\u89c8\u5668\u7aef\u5b8c\u6210\uff0c\u6570\u636e\u4e0d\u4f1a\u4e0a\u4f20\u81f3\u7b2c\u4e09\u65b9\u670d\u52a1\u5668\uff0c\u9690\u79c1\u5b89\u5168\u6027\u76f4\u63a5\u62c9\u6ee1\u3002\u65e0\u8bba\u662f\u505a<strong>\u7167\u7247\u88c1\u526a\u5728\u7ebf<\/strong>\u8fd8\u662f\u590d\u6742\u7684<strong>\u56fe\u50cf\u88c1\u526a<\/strong>\uff0c\u90fd\u4e0d\u9700\u8981\u6ce8\u518c\u8d26\u53f7\uff0c\u5f00\u7bb1\u5373\u7528\u3002<\/div>\n<h2 class=\"mt-5 mb-3 fw-bold text-dark\">\u5f00\u53d1\u8005\u89c6\u89d2\uff1a\u7528Python\u5b9e\u73b0\u81ea\u52a8\u5316\u88c1\u526a\u6d41\u6c34\u7ebf<\/h2>\n<p class=\"mb-3 text-secondary\">\u5f53\u4f60\u9700\u8981\u628a<strong>\u56fe\u7247\u88c1\u526a<\/strong>\u96c6\u6210\u5230CI\/CD\u6d41\u7a0b\uff0c\u6216\u8005\u5904\u7406\u4e0a\u4e07\u5f20\u7528\u6237\u5934\u50cf\u65f6\uff0c\u7eaf\u9760\u7f51\u9875\u70b9\u51fb\u663e\u7136\u4e0d\u591f\u770b\u3002\u8fd9\u65f6\u5019\u638c\u63e1\u4e00\u5957<strong>\u56fe\u7247\u88c1\u526a\u5de5\u5177<\/strong>\u7684\u5e95\u5c42\u903b\u8f91\u5c31\u5f88\u6709\u5fc5\u8981\u3002\u6211\u7528Pillow\u5e93\u5199\u8fc7\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u7684\u811a\u672c\uff0c\u4e13\u95e8\u7528\u6765\u505a<strong>\u6279\u91cf\u88c1\u526a\u56fe\u7247<\/strong>\u548c\u683c\u5f0f\u8f6c\u6362\u3002\u4ee3\u7801\u903b\u8f91\u4e0d\u590d\u6742\uff0c\u4f46\u80fd\u5b8c\u7f8e\u5bf9\u63a5\u73b0\u6709\u7684\u6587\u4ef6\u5b58\u50a8\u7cfb\u7edf\u3002\u76f8\u6bd4\u90a3\u4e9b\u6536\u8d39\u7684<strong>\u56fe\u7247\u88c1\u526a\u5de5\u5177\u5728\u7ebf<\/strong>\u670d\u52a1\uff0c\u81ea\u7814\u811a\u672c\u4e0d\u4ec5\u6ca1\u6709\u6d41\u91cf\u9650\u5236\uff0c\u8fd8\u80fd\u6df1\u5ea6\u5b9a\u5236\u538b\u7f29\u7387\u548c\u8272\u5f69\u7a7a\u95f4\u3002<\/p>\n<div class=\"bg-light p-4 rounded border mb-4 w-100\">\n<pre class=\"mb-0\" style=\"white-space: pre-wrap; font-family: 'Courier New', monospace; font-size: 0.9rem;\"><code class=\"language-python\">from PIL import Image\nimport os\nimport glob\nimport logging\n\nlogging.basicConfig(level=logging.INFO)\n\ndef batch_crop_images(input_dir, output_dir, size=(800, 600)):\n    os.makedirs(output_dir, exist_ok=True)\n    processed_count = 0\n    for img_path in glob.glob(os.path.join(input_dir, '*.{jpg,jpeg,png}')):\n        filename = os.path.basename(img_path)\n        try:\n            with Image.open(img_path) as img:\n                # \u4fdd\u6301\u6bd4\u4f8b\u5c45\u4e2d\u88c1\u526a\uff08CROP\u7b97\u6cd5\uff09\n                left = (img.width - size[0]) \/ 2\n                top = (img.height - size[1]) \/ 2\n                right = left + size[0]\n                bottom = top + size[1]\n                cropped_img = img.crop((left, top, right, bottom))\n                # \u5f3a\u5236\u8f6c\u6362\u4e3aRGB\u9632\u6b62RGBA\u900f\u660e\u901a\u9053\u62a5\u9519\n                if cropped_img.mode == 'RGBA':\n                    cropped_img = cropped_img.convert('RGB')\n                cropped_img.save(os.path.join(output_dir, filename), quality=85)\n                processed_count += 1\n        except Exception as e:\n            logging.error(f\"\u274c \u5931\u8d25: {filename} | {str(e)}\")\n    logging.info(f\"\u2705 \u6279\u91cf\u5904\u7406\u5b8c\u6210\uff0c\u5171\u6210\u529f\u88c1\u526a {processed_count} \u5f20\u56fe\u7247\")\n\n# \u6267\u884c\u5165\u53e3\nif __name__ == \"__main__\":\n    batch_crop_images('.\/source_assets', '.\/optimized_thumbs')\n<\/code><\/pre>\n<\/div>\n<p class=\"mb-3 text-secondary\">\u8fd9\u6bb5\u4ee3\u7801\u7684\u6838\u5fc3\u5728\u4e8e<strong>\u56fe\u50cf\u88c1\u526a<\/strong>\u7684\u5750\u6807\u8ba1\u7b97\u4e0e\u5f02\u5e38\u6355\u83b7\u3002\u5f88\u591a\u65b0\u624b\u5728\u5199<strong>\u56fe\u7247\u5728\u7ebf\u88c1\u526a<\/strong>\u903b\u8f91\u65f6\u5bb9\u6613\u5ffd\u7565\u5c45\u4e2d\u7b97\u6cd5\uff0c\u5bfc\u81f4\u8fb9\u7f18\u88ab\u786c\u751f\u751f\u5207\u65ad\u3002\u4e0a\u9762\u7684\u903b\u8f91\u4f1a\u5148\u8ba1\u7b97\u5bbd\u9ad8\u5dee\u503c\uff0c\u81ea\u52a8\u53d6\u4e2d\u95f4\u533a\u57df\uff0c\u975e\u5e38\u9002\u5408\u505a\u7f29\u7565\u56fe\u751f\u6210\u3002\u5982\u679c\u4f60\u8fd8\u9700\u8981<strong>\u56fe\u7247\u526a\u5207<\/strong>\u7279\u5b9aROI\u533a\u57df\uff0c\u53ea\u9700\u66ff\u6362crop\u51fd\u6570\u7684\u5143\u7ec4\u53c2\u6570\u5373\u53ef\u3002\u914d\u5408schedule\u5e93\u5b9a\u65f6\u8fd0\u884c\uff0c\u8fd9\u5957\u811a\u672c\u5b8c\u5168\u53ef\u4ee5\u66ff\u4ee3\u90a3\u4e9b\u8001\u65e7\u7684<strong>\u7167\u7247\u88c1\u526a\u5728\u7ebf<\/strong>\u670d\u52a1\uff0c\u800c\u4e14\u54cd\u5e94\u901f\u5ea6\u66f4\u5feb\uff0c\u8d44\u6e90\u5360\u7528\u66f4\u4f4e\u3002<\/p>\n<h2 class=\"mt-5 mb-3 fw-bold text-dark\">\u6838\u5fc3\u80fd\u529b\u5bf9\u6bd4\u4e0e\u9009\u578b\u5efa\u8bae<\/h2>\n<p class=\"mb-3 text-secondary\">\u5728\u5b9e\u9645\u4e1a\u52a1\u4e2d\uff0c\u9009<strong>\u88c1\u526a\u56fe\u7247\u5de5\u5177<\/strong>\u8fd8\u662f\u8981\u770b\u5177\u4f53\u573a\u666f\u3002\u6211\u7ed3\u5408\u8fc7\u53bb\u4e09\u5e74\u7684\u9879\u76ee\u7ecf\u9a8c\uff0c\u6574\u7406\u4e86\u4e00\u4efd\u5bf9\u6bd4\u8868\uff0c\u65b9\u4fbf\u5927\u5bb6\u5feb\u901f\u51b3\u7b56\uff1a<\/p>\n<div class=\"table-responsive w-100 mb-4\">\n<table class=\"table table-bordered table-hover align-middle w-100\">\n<thead class=\"table-light\">\n<tr>\n<th scope=\"col\">\u5e94\u7528\u573a\u666f<\/th>\n<th scope=\"col\">\u63a8\u8350\u65b9\u6848<\/th>\n<th scope=\"col\">\u4f18\u52bf\u8bf4\u660e<\/th>\n<th scope=\"col\">\u5178\u578b\u6807\u7b7e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u5355\u6b21\u5c11\u91cf\u4fee\u56fe<\/td>\n<td><span class=\"badge bg-primary\">\u5728\u7ebf\u5207\u56fe\u5e73\u53f0<\/span><\/td>\n<td>\u96f6\u914d\u7f6e\uff0c\u62d6\u62fd\u5373\u7528\uff0c\u652f\u6301<b>\u56fe\u7247\u88c1\u526a\u6210\u4efb\u610f\u5f62\u72b6<\/b>\u4e0e\u5373\u65f6\u9884\u89c8<\/td>\n<td>\u5728\u7ebf\u88c1\u526a\u56fe\u7247, \u56fe\u7247\u7f16\u8f91\u5668, \u88c1\u5207\u5de5\u5177<\/td>\n<\/tr>\n<tr>\n<td>\u7535\u5546\/\u81ea\u5a92\u4f53\u77e9\u9635<\/td>\n<td><span class=\"badge bg-success\">\u6279\u91cf\u88c1\u526a\u8f6f\u4ef6<\/span><\/td>\n<td>\u591a\u5c3a\u5bf8\u540c\u6b65\u5bfc\u51fa\uff0c\u4fdd\u7559EXIF\u4fe1\u606f\uff0c\u652f\u6301\u81ea\u5b9a\u4e49\u6c34\u5370\u53e0\u52a0<\/td>\n<td>\u56fe\u7247\u6279\u91cf\u88c1\u526a, \u539f\u56fe\u7247\u526a\u88c1\u9884\u89c8\u56fe, \u7167\u7247\u526a\u88c1<\/td>\n<\/tr>\n<tr>\n<td>\u540e\u7aef\u81ea\u52a8\u5316\u6d41\u6c34\u7ebf<\/td>\n<td><span class=\"badge bg-warning text-dark\">Python\/Pillow<\/span><\/td>\n<td>\u9ad8\u5e76\u53d1\u5904\u7406\uff0c\u65e0\u7f1d\u5bf9\u63a5\u4e91\u5b58\u50a8\u4e0eCDN\uff0c\u53ef\u5b9a\u5236\u538b\u7f29\u7b56\u7565<\/td>\n<td>\u56fe\u50cf\u88c1\u526a, \u56fe\u7247\u5206\u5272, \u526a\u8f91\u56fe\u7247<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p class=\"mb-3 text-secondary\">\u603b\u7ed3\u4e0b\u6765\uff0c<strong>\u5982\u4f55\u88c1\u526a\u56fe\u7247<\/strong>\u4ece\u6765\u4e0d\u662f\u5355\u4e00\u7ef4\u5ea6\u7684\u95ee\u9898\u3002\u5982\u679c\u662f\u4e34\u65f6\u6539\u4e2aBanner\uff0c\u76f4\u63a5\u7528\u90a3\u4e2a\u5728\u7ebf\u5de5\u5177\u7684<strong>\u5706\u5f62\u56fe\u7247\u88c1\u526a<\/strong>\u548c<strong>\u4e00\u5bf8\u7167\u7247\u88c1\u526a<\/strong>\u6a21\u5757\u6700\u5feb\uff1b\u5982\u679c\u662f\u505aSaaS\u4ea7\u54c1\u7684\u5e95\u5c42\u80fd\u529b\uff0c\u8fd8\u662f\u5f97\u81ea\u5df1\u5c01\u88c5\u4e00\u5957<strong>\u56fe\u7247\u5206\u5272<\/strong>\u63a5\u53e3\u3002\u5de5\u5177\u53ea\u662f\u8f7d\u4f53\uff0c\u5173\u952e\u662f\u7406\u6e05\u4f60\u7684\u5de5\u4f5c\u6d41\u74f6\u9888\u5728\u54ea\u91cc\u3002\u5e73\u65f6\u591a\u79ef\u7d2f\u4e00\u4e9b<strong>\u526a\u8f91\u56fe\u7247<\/strong>\u548c<strong>\u5728\u7ebf\u56fe\u7247\u7f16\u8f91<\/strong>\u7684\u5feb\u6377\u64cd\u4f5c\uff0c\u80fd\u5728\u5173\u952e\u65f6\u523b\u8282\u7701\u5927\u91cf\u6c9f\u901a\u6210\u672c\u3002\u8bb0\u4f4f\uff0c\u597d\u7684<strong>\u56fe\u7247\u526a\u5207<\/strong>\u6d41\u7a0b\u5e94\u8be5\u662f\u65e0\u611f\u77e5\u7684\uff0c\u800c\u4e0d\u662f\u8ba9\u4f60\u53cd\u590d\u5207\u6362\u7a97\u53e3\u53bb\u8c03\u6574\u53c2\u6570\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u63a2\u7d22\u9ad8\u6548\u56fe\u7247\u88c1\u526a\u65b9\u6848\uff0c\u4ece\u5728\u7ebf\u514d\u8d39\u5de5\u5177\u5230Python\u81ea\u52a8\u5316\u811a\u672c\u3002\u8be6\u89e3\u6279\u91cf\u88c1\u526a\u3001\u81ea\u5b9a\u4e49\u5f62\u72b6\u88c1\u5207\u53ca\u8bc1\u4ef6\u7167\u751f\u6210\u6280\u5de7\uff0c\u9644\u5f00\u53d1\u8005\u5b9e\u6218\u4ee3\u7801\u4e0e\u6027\u80fd\u5bf9\u6bd4\u8868\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[150,236,391],"class_list":["post-1156","post","type-post","status-publish","format-standard","hentry","category-best-articles","tag-150","tag-236","tag-391"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.3.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u9ad8\u6548\u56fe\u7247\u88c1\u526a\u6307\u5357\uff1a\u5728\u7ebf\u5de5\u5177\u4e0ePython\u81ea\u52a8\u5316\u5b9e\u6218 - nimail blog<\/title>\n<meta name=\"description\" content=\"\u63a2\u7d22\u9ad8\u6548\u56fe\u7247\u88c1\u526a\u65b9\u6848\uff0c\u4ece\u5728\u7ebf\u514d\u8d39\u5de5\u5177\u5230Python\u81ea\u52a8\u5316\u811a\u672c\u3002\u8be6\u89e3\u6279\u91cf\u88c1\u526a\u3001\u81ea\u5b9a\u4e49\u5f62\u72b6\u88c1\u5207\u53ca\u8bc1\u4ef6\u7167\u751f\u6210\u6280\u5de7\uff0c\u9644\u5f00\u53d1\u8005\u5b9e\u6218\u4ee3\u7801\u4e0e\u6027\u80fd\u5bf9\u6bd4\u8868\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.nimail.cn\/best-articles\/\u9ad8\u6548\u56fe\u7247\u88c1\u526a\u6307\u5357-\u5728\u7ebf\u5de5\u5177\u4e0epython\u81ea\u52a8\u5316\u5b9e\u6218\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u9ad8\u6548\u56fe\u7247\u88c1\u526a\u6307\u5357\uff1a\u5728\u7ebf\u5de5\u5177\u4e0ePython\u81ea\u52a8\u5316\u5b9e\u6218 - nimail blog\" \/>\n<meta property=\"og:description\" content=\"\u63a2\u7d22\u9ad8\u6548\u56fe\u7247\u88c1\u526a\u65b9\u6848\uff0c\u4ece\u5728\u7ebf\u514d\u8d39\u5de5\u5177\u5230Python\u81ea\u52a8\u5316\u811a\u672c\u3002\u8be6\u89e3\u6279\u91cf\u88c1\u526a\u3001\u81ea\u5b9a\u4e49\u5f62\u72b6\u88c1\u5207\u53ca\u8bc1\u4ef6\u7167\u751f\u6210\u6280\u5de7\uff0c\u9644\u5f00\u53d1\u8005\u5b9e\u6218\u4ee3\u7801\u4e0e\u6027\u80fd\u5bf9\u6bd4\u8868\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.nimail.cn\/best-articles\/\u9ad8\u6548\u56fe\u7247\u88c1\u526a\u6307\u5357-\u5728\u7ebf\u5de5\u5177\u4e0epython\u81ea\u52a8\u5316\u5b9e\u6218\/\" \/>\n<meta property=\"og:site_name\" content=\"nimail blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-12T12:25:08+00:00\" \/>\n<meta name=\"author\" content=\"\u4e00\u7ebf\u7801\u519c\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u4e00\u7ebf\u7801\u519c\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blog.nimail.cn\/best-articles\/%e9%ab%98%e6%95%88%e5%9b%be%e7%89%87%e8%a3%81%e5%89%aa%e6%8c%87%e5%8d%97-%e5%9c%a8%e7%ba%bf%e5%b7%a5%e5%85%b7%e4%b8%8epython%e8%87%aa%e5%8a%a8%e5%8c%96%e5%ae%9e%e6%88%98\/\",\"url\":\"https:\/\/blog.nimail.cn\/best-articles\/%e9%ab%98%e6%95%88%e5%9b%be%e7%89%87%e8%a3%81%e5%89%aa%e6%8c%87%e5%8d%97-%e5%9c%a8%e7%ba%bf%e5%b7%a5%e5%85%b7%e4%b8%8epython%e8%87%aa%e5%8a%a8%e5%8c%96%e5%ae%9e%e6%88%98\/\",\"name\":\"\u9ad8\u6548\u56fe\u7247\u88c1\u526a\u6307\u5357\uff1a\u5728\u7ebf\u5de5\u5177\u4e0ePython\u81ea\u52a8\u5316\u5b9e\u6218 - nimail blog\",\"isPartOf\":{\"@id\":\"https:\/\/blog.nimail.cn\/#website\"},\"datePublished\":\"2026-07-12T12:25:08+00:00\",\"author\":{\"@id\":\"https:\/\/blog.nimail.cn\/#\/schema\/person\/0b0e15eb489135cbe0643e4f5e8839af\"},\"description\":\"\u63a2\u7d22\u9ad8\u6548\u56fe\u7247\u88c1\u526a\u65b9\u6848\uff0c\u4ece\u5728\u7ebf\u514d\u8d39\u5de5\u5177\u5230Python\u81ea\u52a8\u5316\u811a\u672c\u3002\u8be6\u89e3\u6279\u91cf\u88c1\u526a\u3001\u81ea\u5b9a\u4e49\u5f62\u72b6\u88c1\u5207\u53ca\u8bc1\u4ef6\u7167\u751f\u6210\u6280\u5de7\uff0c\u9644\u5f00\u53d1\u8005\u5b9e\u6218\u4ee3\u7801\u4e0e\u6027\u80fd\u5bf9\u6bd4\u8868\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/blog.nimail.cn\/best-articles\/%e9%ab%98%e6%95%88%e5%9b%be%e7%89%87%e8%a3%81%e5%89%aa%e6%8c%87%e5%8d%97-%e5%9c%a8%e7%ba%bf%e5%b7%a5%e5%85%b7%e4%b8%8epython%e8%87%aa%e5%8a%a8%e5%8c%96%e5%ae%9e%e6%88%98\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/blog.nimail.cn\/best-articles\/%e9%ab%98%e6%95%88%e5%9b%be%e7%89%87%e8%a3%81%e5%89%aa%e6%8c%87%e5%8d%97-%e5%9c%a8%e7%ba%bf%e5%b7%a5%e5%85%b7%e4%b8%8epython%e8%87%aa%e5%8a%a8%e5%8c%96%e5%ae%9e%e6%88%98\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/blog.nimail.cn\/best-articles\/%e9%ab%98%e6%95%88%e5%9b%be%e7%89%87%e8%a3%81%e5%89%aa%e6%8c%87%e5%8d%97-%e5%9c%a8%e7%ba%bf%e5%b7%a5%e5%85%b7%e4%b8%8epython%e8%87%aa%e5%8a%a8%e5%8c%96%e5%ae%9e%e6%88%98\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/blog.nimail.cn\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u9ad8\u6548\u56fe\u7247\u88c1\u526a\u6307\u5357\uff1a\u5728\u7ebf\u5de5\u5177\u4e0ePython\u81ea\u52a8\u5316\u5b9e\u6218\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/blog.nimail.cn\/#website\",\"url\":\"https:\/\/blog.nimail.cn\/\",\"name\":\"nimail blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/blog.nimail.cn\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/blog.nimail.cn\/#\/schema\/person\/0b0e15eb489135cbe0643e4f5e8839af\",\"name\":\"\u4e00\u7ebf\u7801\u519c\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/blog.nimail.cn\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/9cabb5645eed3060ef0005d4a179e6422ed56568f78c1b5d2326a4976200739c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/9cabb5645eed3060ef0005d4a179e6422ed56568f78c1b5d2326a4976200739c?s=96&d=mm&r=g\",\"caption\":\"\u4e00\u7ebf\u7801\u519c\"},\"sameAs\":[\"http:\/\/blog.nimail.cn\"],\"url\":\"https:\/\/blog.nimail.cn\/author\/longzg\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u9ad8\u6548\u56fe\u7247\u88c1\u526a\u6307\u5357\uff1a\u5728\u7ebf\u5de5\u5177\u4e0ePython\u81ea\u52a8\u5316\u5b9e\u6218 - nimail blog","description":"\u63a2\u7d22\u9ad8\u6548\u56fe\u7247\u88c1\u526a\u65b9\u6848\uff0c\u4ece\u5728\u7ebf\u514d\u8d39\u5de5\u5177\u5230Python\u81ea\u52a8\u5316\u811a\u672c\u3002\u8be6\u89e3\u6279\u91cf\u88c1\u526a\u3001\u81ea\u5b9a\u4e49\u5f62\u72b6\u88c1\u5207\u53ca\u8bc1\u4ef6\u7167\u751f\u6210\u6280\u5de7\uff0c\u9644\u5f00\u53d1\u8005\u5b9e\u6218\u4ee3\u7801\u4e0e\u6027\u80fd\u5bf9\u6bd4\u8868\u3002","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:\/\/blog.nimail.cn\/best-articles\/\u9ad8\u6548\u56fe\u7247\u88c1\u526a\u6307\u5357-\u5728\u7ebf\u5de5\u5177\u4e0epython\u81ea\u52a8\u5316\u5b9e\u6218\/","og_locale":"zh_CN","og_type":"article","og_title":"\u9ad8\u6548\u56fe\u7247\u88c1\u526a\u6307\u5357\uff1a\u5728\u7ebf\u5de5\u5177\u4e0ePython\u81ea\u52a8\u5316\u5b9e\u6218 - nimail blog","og_description":"\u63a2\u7d22\u9ad8\u6548\u56fe\u7247\u88c1\u526a\u65b9\u6848\uff0c\u4ece\u5728\u7ebf\u514d\u8d39\u5de5\u5177\u5230Python\u81ea\u52a8\u5316\u811a\u672c\u3002\u8be6\u89e3\u6279\u91cf\u88c1\u526a\u3001\u81ea\u5b9a\u4e49\u5f62\u72b6\u88c1\u5207\u53ca\u8bc1\u4ef6\u7167\u751f\u6210\u6280\u5de7\uff0c\u9644\u5f00\u53d1\u8005\u5b9e\u6218\u4ee3\u7801\u4e0e\u6027\u80fd\u5bf9\u6bd4\u8868\u3002","og_url":"https:\/\/blog.nimail.cn\/best-articles\/\u9ad8\u6548\u56fe\u7247\u88c1\u526a\u6307\u5357-\u5728\u7ebf\u5de5\u5177\u4e0epython\u81ea\u52a8\u5316\u5b9e\u6218\/","og_site_name":"nimail blog","article_published_time":"2026-07-12T12:25:08+00:00","author":"\u4e00\u7ebf\u7801\u519c","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u4e00\u7ebf\u7801\u519c","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/blog.nimail.cn\/best-articles\/%e9%ab%98%e6%95%88%e5%9b%be%e7%89%87%e8%a3%81%e5%89%aa%e6%8c%87%e5%8d%97-%e5%9c%a8%e7%ba%bf%e5%b7%a5%e5%85%b7%e4%b8%8epython%e8%87%aa%e5%8a%a8%e5%8c%96%e5%ae%9e%e6%88%98\/","url":"https:\/\/blog.nimail.cn\/best-articles\/%e9%ab%98%e6%95%88%e5%9b%be%e7%89%87%e8%a3%81%e5%89%aa%e6%8c%87%e5%8d%97-%e5%9c%a8%e7%ba%bf%e5%b7%a5%e5%85%b7%e4%b8%8epython%e8%87%aa%e5%8a%a8%e5%8c%96%e5%ae%9e%e6%88%98\/","name":"\u9ad8\u6548\u56fe\u7247\u88c1\u526a\u6307\u5357\uff1a\u5728\u7ebf\u5de5\u5177\u4e0ePython\u81ea\u52a8\u5316\u5b9e\u6218 - nimail blog","isPartOf":{"@id":"https:\/\/blog.nimail.cn\/#website"},"datePublished":"2026-07-12T12:25:08+00:00","author":{"@id":"https:\/\/blog.nimail.cn\/#\/schema\/person\/0b0e15eb489135cbe0643e4f5e8839af"},"description":"\u63a2\u7d22\u9ad8\u6548\u56fe\u7247\u88c1\u526a\u65b9\u6848\uff0c\u4ece\u5728\u7ebf\u514d\u8d39\u5de5\u5177\u5230Python\u81ea\u52a8\u5316\u811a\u672c\u3002\u8be6\u89e3\u6279\u91cf\u88c1\u526a\u3001\u81ea\u5b9a\u4e49\u5f62\u72b6\u88c1\u5207\u53ca\u8bc1\u4ef6\u7167\u751f\u6210\u6280\u5de7\uff0c\u9644\u5f00\u53d1\u8005\u5b9e\u6218\u4ee3\u7801\u4e0e\u6027\u80fd\u5bf9\u6bd4\u8868\u3002","breadcrumb":{"@id":"https:\/\/blog.nimail.cn\/best-articles\/%e9%ab%98%e6%95%88%e5%9b%be%e7%89%87%e8%a3%81%e5%89%aa%e6%8c%87%e5%8d%97-%e5%9c%a8%e7%ba%bf%e5%b7%a5%e5%85%b7%e4%b8%8epython%e8%87%aa%e5%8a%a8%e5%8c%96%e5%ae%9e%e6%88%98\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.nimail.cn\/best-articles\/%e9%ab%98%e6%95%88%e5%9b%be%e7%89%87%e8%a3%81%e5%89%aa%e6%8c%87%e5%8d%97-%e5%9c%a8%e7%ba%bf%e5%b7%a5%e5%85%b7%e4%b8%8epython%e8%87%aa%e5%8a%a8%e5%8c%96%e5%ae%9e%e6%88%98\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/blog.nimail.cn\/best-articles\/%e9%ab%98%e6%95%88%e5%9b%be%e7%89%87%e8%a3%81%e5%89%aa%e6%8c%87%e5%8d%97-%e5%9c%a8%e7%ba%bf%e5%b7%a5%e5%85%b7%e4%b8%8epython%e8%87%aa%e5%8a%a8%e5%8c%96%e5%ae%9e%e6%88%98\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/blog.nimail.cn\/"},{"@type":"ListItem","position":2,"name":"\u9ad8\u6548\u56fe\u7247\u88c1\u526a\u6307\u5357\uff1a\u5728\u7ebf\u5de5\u5177\u4e0ePython\u81ea\u52a8\u5316\u5b9e\u6218"}]},{"@type":"WebSite","@id":"https:\/\/blog.nimail.cn\/#website","url":"https:\/\/blog.nimail.cn\/","name":"nimail blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.nimail.cn\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/blog.nimail.cn\/#\/schema\/person\/0b0e15eb489135cbe0643e4f5e8839af","name":"\u4e00\u7ebf\u7801\u519c","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/blog.nimail.cn\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/9cabb5645eed3060ef0005d4a179e6422ed56568f78c1b5d2326a4976200739c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9cabb5645eed3060ef0005d4a179e6422ed56568f78c1b5d2326a4976200739c?s=96&d=mm&r=g","caption":"\u4e00\u7ebf\u7801\u519c"},"sameAs":["http:\/\/blog.nimail.cn"],"url":"https:\/\/blog.nimail.cn\/author\/longzg\/"}]}},"_links":{"self":[{"href":"https:\/\/blog.nimail.cn\/wp-json\/wp\/v2\/posts\/1156","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.nimail.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.nimail.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.nimail.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.nimail.cn\/wp-json\/wp\/v2\/comments?post=1156"}],"version-history":[{"count":0,"href":"https:\/\/blog.nimail.cn\/wp-json\/wp\/v2\/posts\/1156\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.nimail.cn\/wp-json\/wp\/v2\/media?parent=1156"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.nimail.cn\/wp-json\/wp\/v2\/categories?post=1156"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.nimail.cn\/wp-json\/wp\/v2\/tags?post=1156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}