{"id":2476,"date":"2025-05-20T00:00:11","date_gmt":"2025-05-19T16:00:11","guid":{"rendered":"https:\/\/www.wunen.com\/index.php\/2025\/05\/20\/python%e5%8a%9e%e5%85%ac-openpyxl%e5%a2%9e%e5%8a%a0%e3%80%81%e5%88%a0%e9%99%a4%e8%a1%8c%e5%88%97%ef%bc%8c%e4%bf%ae%e6%94%b9%e5%8d%95%e5%85%83%e6%a0%bc%ef%bc%8c%e5%ba%95%e8%89%b2%e3%80%81\/"},"modified":"2025-05-20T00:00:11","modified_gmt":"2025-05-19T16:00:11","slug":"python%e5%8a%9e%e5%85%ac-openpyxl%e5%a2%9e%e5%8a%a0%e3%80%81%e5%88%a0%e9%99%a4%e8%a1%8c%e5%88%97%ef%bc%8c%e4%bf%ae%e6%94%b9%e5%8d%95%e5%85%83%e6%a0%bc%ef%bc%8c%e5%ba%95%e8%89%b2%e3%80%81","status":"publish","type":"post","link":"http:\/\/www.wunen.com\/index.php\/2025\/05\/20\/python%e5%8a%9e%e5%85%ac-openpyxl%e5%a2%9e%e5%8a%a0%e3%80%81%e5%88%a0%e9%99%a4%e8%a1%8c%e5%88%97%ef%bc%8c%e4%bf%ae%e6%94%b9%e5%8d%95%e5%85%83%e6%a0%bc%ef%bc%8c%e5%ba%95%e8%89%b2%e3%80%81\/","title":{"rendered":"Python\u529e\u516c\u2014openpyxl(\u589e\u52a0\u3001\u5220\u9664\u884c\u5217\uff0c\u4fee\u6539\u5355\u5143\u683c\uff0c\u5e95\u8272\u3001\u5b57\u4f53\u6837\u5f0f\u8bbe\u7f6e\uff0c\u8bfb\u53d6sheet\u8868)"},"content":{"rendered":"<div class=\"article_content clearfix\" id=\"article_content\">\n <link href=\"https:\/\/csdnimg.cn\/release\/blogv2\/dist\/mdeditor\/css\/editerView\/kdoc_html_views-1a98987dfd.css\" rel=\"stylesheet\"\/>\n <link href=\"https:\/\/csdnimg.cn\/release\/blogv2\/dist\/mdeditor\/css\/editerView\/ck_htmledit_views-704d5b9767.css\" rel=\"stylesheet\"\/>\n<div class=\"markdown_views prism-atom-one-dark\" id=\"content_views\">\n  <svg style=\"display: none;\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n   <path d=\"M5,0 0,2.5 5,5z\" id=\"raphael-marker-block\" stroke-linecap=\"round\" style=\"-webkit-tap-highlight-color: rgba(0, 0, 0, 0);\">\n   <\/path>\n  <\/svg><\/p>\n<div class=\"toc\">\n<h4>\n    <font color=\"orange\" size=\"5\"><br \/>\n     \u76ee\u5f55<br \/>\n    <\/font><br \/>\n   <\/h4>\n<ul>\n<li>\n     <a href=\"#_19\" rel=\"nofollow\"><br \/>\n      \u4e13\u680f\u5bfc\u8bfb<br \/>\n     <\/a>\n    <\/li>\n<li>\n     <a href=\"#_33\" rel=\"nofollow\"><br \/>\n      \u5e93\u7684\u4ecb\u7ecd<br \/>\n     <\/a>\n    <\/li>\n<li>\n     <a href=\"#_51\" rel=\"nofollow\"><br \/>\n      \u5e93\u7684\u5b89\u88c5<br \/>\n     <\/a>\n    <\/li>\n<li>\n     <a href=\"#1Excel_63\" rel=\"nofollow\"><br \/>\n      1\u3001\u8bfb\u53d6Excel\u6587\u4ef6\uff08\u6309\u884c\u8bfb\u53d6\uff09<br \/>\n     <\/a>\n    <\/li>\n<li>\n     <a href=\"#2Excel_92\" rel=\"nofollow\"><br \/>\n      2\u3001\u8bfb\u53d6Excel\u6587\u4ef6\uff08\u6309\u67d0\u5217\u8bfb\u53d6\uff09<br \/>\n     <\/a>\n    <\/li>\n<li>\n     <a href=\"#3_119\" rel=\"nofollow\"><br \/>\n      3\u3001\u65b0\u589e\u4e00\u5217<br \/>\n     <\/a>\n    <\/li>\n<li>\n     <a href=\"#4_136\" rel=\"nofollow\"><br \/>\n      4\u3001\u5220\u9664\u4e00\u5217<br \/>\n     <\/a>\n    <\/li>\n<li>\n     <a href=\"#5_161\" rel=\"nofollow\"><br \/>\n      5\u3001\u63d2\u5165\u4e00\u884c<br \/>\n     <\/a>\n    <\/li>\n<li>\n     <a href=\"#6_177\" rel=\"nofollow\"><br \/>\n      6\u3001\u5220\u9664\u4e00\u884c<br \/>\n     <\/a>\n    <\/li>\n<li>\n     <a href=\"#7_198\" rel=\"nofollow\"><br \/>\n      7\u3001\u4fee\u6539\u5355\u5143\u683c\u503c<br \/>\n     <\/a>\n    <\/li>\n<li>\n     <a href=\"#8_216\" rel=\"nofollow\"><br \/>\n      8\u3001\u4fee\u6539\u5355\u5143\u5e95\u8272<br \/>\n     <\/a>\n    <\/li>\n<li>\n     <a href=\"#9_237\" rel=\"nofollow\"><br \/>\n      9\u3001\u4fee\u6539\u5355\u5143\u683c\u5b57\u4f53<br \/>\n     <\/a>\n    <\/li>\n<li>\n     <a href=\"#10sheet_sheet_259\" rel=\"nofollow\"><br \/>\n      10\u3001\u83b7\u53d6sheet\u8868 \u5207\u6362sheet\u8868<br \/>\n     <\/a>\n    <\/li>\n<li>\n     <a href=\"#_289\" rel=\"nofollow\"><br \/>\n      \u603b\u7ed3<br \/>\n     <\/a>\n    <\/li>\n<\/ul><\/div>\n<\/p>\n<table>\n<thead>\n<tr>\n<th>\n      \u6587\u7ae0\u540d\u79f0\n     <\/th>\n<th>\n      \u94fe\u63a5\u76f4\u8fbe\n     <\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\n      Python\u529e\u516c\u2014openpyxl\u5408\u5e76\u5355\u5143\u683c\n     <\/td>\n<td>\n      <a href=\"https:\/\/blog.csdn.net\/weixin_42636075\/article\/details\/138340855\"><br \/>\n       https:\/\/blog.csdn.net\/weixin_42636075\/article\/details\/138340855<br \/>\n      <\/a>\n     <\/td>\n<\/tr>\n<tr>\n<td>\n      openpyxl\\pandas\\xlwings\\xlrd\\Spire.XLS)\u770b\u8c01\u7528\u65f6\u5c11\n     <\/td>\n<td>\n      <a href=\"https:\/\/blog.csdn.net\/weixin_42636075\/article\/details\/133269740\"><br \/>\n       https:\/\/blog.csdn.net\/weixin_42636075\/article\/details\/133269740<br \/>\n      <\/a>\n     <\/td>\n<\/tr>\n<tr>\n<td>\n      openpyxl\u8bfb\u53d6Excel\u6587\u4ef6\u5ffd\u7565\u5355\u5143\u683c\u516c\u5f0f\n     <\/td>\n<td>\n      <a href=\"https:\/\/blog.csdn.net\/weixin_42636075\/article\/details\/134877961\"><br \/>\n       https:\/\/blog.csdn.net\/weixin_42636075\/article\/details\/134877961<br \/>\n      <\/a>\n     <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr\/>\n<table>\n<thead>\n<tr>\n<th align=\"left\">\n      \u8bfe\u7a0b\u540d\u79f0\n     <\/th>\n<th>\n      \u94fe\u63a5\u76f4\u8fbe\n     <\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td align=\"left\">\n      30\u5929\u5165\u95e8Python\uff08\u57fa\u7840\u7bc7\uff09\u2014\u2014\u7b2c1\u5929\uff1a\u4e3a\u4ec0\u4e48\u9009\u62e9Python\n     <\/td>\n<td>\n      <a href=\"https:\/\/blog.csdn.net\/weixin_42636075\/article\/details\/132686121\"><br \/>\n       https:\/\/blog.csdn.net\/weixin_42636075\/article\/details\/132686121<br \/>\n      <\/a>\n     <\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\n      30\u5929\u5165\u95e8Python\uff08\u57fa\u7840\u7bc7\uff09\u2014\u2014\u7b2c2\u5929\uff1aPython\u5b89\u88c5\uff08\u4fdd\u59c6\u7ea7\uff09\u4e0eIDE\u7684\u8ba4\u8bc6\u4e0e\u9009\u62e9+\u8be6\u7ec6\u5b89\u88c5\u6559\u7a0b(\u4e07\u5b57\u5efa\u8bae\u6536\u85cf)\n     <\/td>\n<td>\n      <a href=\"https:\/\/blog.csdn.net\/weixin_42636075\/article\/details\/132711544\"><br \/>\n       https:\/\/blog.csdn.net\/weixin_42636075\/article\/details\/132711544<br \/>\n      <\/a>\n     <\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\n      30\u5929\u5165\u95e8Python\uff08\u57fa\u7840\u7bc7\uff09\u2014\u2014\u7b2c3\u5929\uff1a\u3010\u53d8\u91cf\u3011\u4e0e\u3010\u8f93\u51fa\u3011\u4e0e\u3010\u8f6c\u4e49\u7b26\u3011(\u4e07\u5b57\u89e3\u6790\uff0c\u5efa\u8bae\u6536\u85cf)\n     <\/td>\n<td>\n      <a href=\"https:\/\/blog.csdn.net\/weixin_42636075\/article\/details\/132800141\"><br \/>\n       https:\/\/blog.csdn.net\/weixin_42636075\/article\/details\/132800141<br \/>\n      <\/a>\n     <\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\n      30\u5929\u5165\u95e8Python\uff08\u57fa\u7840\u7bc7\uff09\u2014\u2014\u7b2c4\u5929\uff1aPython\u4e2d\u7684\u3010\u8f93\u5165\u3011+\u3010\u6570\u636e\u7c7b\u578b\u3011\u7684\u8ba4\u8bc6(\u4e07\u5b57\u5efa\u8bae\u70b9\u8d5e\u6536\u85cf)\n     <\/td>\n<td>\n      <a href=\"https:\/\/blog.csdn.net\/weixin_42636075\/article\/details\/132878795\"><br \/>\n       https:\/\/blog.csdn.net\/weixin_42636075\/article\/details\/132878795<br \/>\n      <\/a>\n     <\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\n      30\u5929\u5165\u95e8Python\uff08\u57fa\u7840\u7bc7\uff09\u2014\u2014\u7b2c5\u5929\uff1a\u5217\u8868\\\u5b57\u5178\u7684\u8865\u5145\u8bf4\u660e&amp;\u5b57\u7b26\u4e32\u5207\u7247\\\u5217\u8868\u5207\u7247(\u4fdd\u59c6\u7ea7+\u4e07\u5b57)\n     <\/td>\n<td>\n      <a href=\"https:\/\/blog.csdn.net\/weixin_42636075\/article\/details\/133747895\"><br \/>\n       https:\/\/blog.csdn.net\/weixin_42636075\/article\/details\/133747895<br \/>\n      <\/a>\n     <\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\n      30\u5929\u5165\u95e8Python\uff08\u57fa\u7840\u7bc7\uff09\u2014\u2014\u7b2c6\u5929\uff1a\u6570\u636e\u7c7b\u578b\u8f6c\u6362(\u5b57\u7b26\u4e32-\u6574\u6570-\u6d6e\u70b9\u6570\u4e09\u8005\u4e4b\u95f4\u7684\u76f8\u4e92\u8f6c\u6362)\n     <\/td>\n<td>\n      <a href=\"https:\/\/blog.csdn.net\/weixin_42636075\/article\/details\/134443494\"><br \/>\n       https:\/\/blog.csdn.net\/weixin_42636075\/article\/details\/134443494<br \/>\n      <\/a>\n     <\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\n      30\u5929\u5165\u95e8Python\uff08\u57fa\u7840\u7bc7\uff09\u2014\u2014\u7b2c6\u5929\uff1a\u6570\u636e\u7c7b\u578b\u8f6c\u6362(\u5b57\u7b26\u4e32-\u6574\u6570-\u6d6e\u70b9\u6570\u4e09\u8005\u4e4b\u95f4\u7684\u76f8\u4e92\u8f6c\u6362)\n     <\/td>\n<td>\n      <a href=\"https:\/\/blog.csdn.net\/weixin_42636075\/article\/details\/134443494\"><br \/>\n       https:\/\/blog.csdn.net\/weixin_42636075\/article\/details\/134443494<br \/>\n      <\/a>\n     <\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\n      30\u5929\u5165\u95e8Python\uff08\u57fa\u7840\u7bc7\uff09\u2014\u2014\u7b2c7\u5929\uff1aPython\u4e2d\u8fd0\u7b97\u7b26\u8be6\u89e3\n     <\/td>\n<td>\n      <a href=\"https:\/\/blog.csdn.net\/weixin_42636075\/article\/details\/134927877\"><br \/>\n       https:\/\/blog.csdn.net\/weixin_42636075\/article\/details\/134927877<br \/>\n      <\/a>\n     <\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\n      30\u5929\u5165\u95e8Python\uff08\u57fa\u7840\u7bc7\uff09\u2014\u2014\u7b2c8\u5929\uff1aPython\u8bed\u6cd5\u9636\u6bb5\u2014\u2014\u6761\u4ef6\u63a7\u5236\u8bed\u53e5\u2014if\u8bed\u53e5\n     <\/td>\n<td>\n      <a href=\"https:\/\/blog.csdn.net\/weixin_42636075\/article\/details\/134949758\"><br \/>\n       https:\/\/blog.csdn.net\/weixin_42636075\/article\/details\/134949758<br \/>\n      <\/a>\n     <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>\n   <a id=\"_19\"><br \/>\n   <\/a><br \/>\n   \u4e13\u680f\u5bfc\u8bfb<br \/>\n  <\/h2>\n<blockquote>\n<ul>\n<li>\n<h3>\n      \ud83c\udf38 \u6b22\u8fce\u6765\u5230Python\u529e\u516c\u81ea\u52a8\u5316\u4e13\u680f\u2014Python\u5904\u7406\u529e\u516c\u95ee\u9898\uff0c\u89e3\u653e\u60a8\u7684\u53cc\u624b<br \/>\n     <\/h3>\n<\/li>\n<li>\n<h3>\n      \ud83c\udff3\ufe0f\u200d\ud83c\udf08 \u535a\u5ba2\u4e3b\u9875\uff1a\u8bf7\u70b9\u51fb\u2014\u2014&gt;<br \/>\n      <a href=\"https:\/\/blog.csdn.net\/weixin_42636075?spm=1010.2135.3001.5421\"><br \/>\n       \u4e00\u664c\u5c0f\u8d2a\u6b22\u7684\u535a\u5ba2\u4e3b\u9875<br \/>\n      <\/a><br \/>\n      \u6c42\u5173\u6ce8<br \/>\n     <\/h3>\n<\/li>\n<li>\n<h3>\n      \ud83d\udc4d \u8be5\u7cfb\u5217\u6587\u7ae0\u4e13\u680f\uff1a\u8bf7\u70b9\u51fb\u2014\u2014&gt;<br \/>\n      <a href=\"https:\/\/blog.csdn.net\/weixin_42636075\/category_8127739.html?spm=1001.2014.3001.5482\"><br \/>\n       Python\u529e\u516c\u81ea\u52a8\u5316\u4e13\u680f<br \/>\n      <\/a><br \/>\n      \u6c42\u8ba2\u9605<br \/>\n     <\/h3>\n<\/li>\n<li>\n<h3>\n      \ud83d\udd77 \u6b64\u5916\u8fd8\u6709\u722c\u866b\u4e13\u680f\uff1a\u8bf7\u70b9\u51fb\u2014\u2014&gt;<br \/>\n      <a href=\"https:\/\/blog.csdn.net\/weixin_42636075\/category_11978272.html\"><br \/>\n       Python\u722c\u866b\u57fa\u7840\u4e13\u680f<br \/>\n      <\/a><br \/>\n      \u6c42\u8ba2\u9605<br \/>\n     <\/h3>\n<\/li>\n<li>\n<h3>\n      \ud83d\udcd5 \u6b64\u5916\u8fd8\u6709python\u57fa\u7840\u4e13\u680f\uff1a\u8bf7\u70b9\u51fb\u2014\u2014&gt;<br \/>\n      <a href=\"https:\/\/blog.csdn.net\/weixin_42636075\/category_12434374.html?spm=1001.2014.3001.5482\"><br \/>\n       Python\u57fa\u7840\u5b66\u4e60\u4e13\u680f<br \/>\n      <\/a><br \/>\n      \u6c42\u8ba2\u9605<br \/>\n     <\/h3>\n<\/li>\n<li>\n<h3>\n      \u6587\u7ae0\u4f5c\u8005\u6280\u672f\u548c\u6c34\u5e73\u6709\u9650\uff0c\u5982\u679c\u6587\u4e2d\u51fa\u73b0\u9519\u8bef\uff0c\u5e0c\u671b\u5927\u5bb6\u80fd\u6307\u6b63\ud83d\ude4f<br \/>\n     <\/h3>\n<\/li>\n<li>\n<h3>\n      \u2764\ufe0f \u6b22\u8fce\u5404\u4f4d\u4f6c\u5173\u6ce8\uff01 \u2764\ufe0f<br \/>\n     <\/h3>\n<\/li>\n<\/ul>\n<\/blockquote>\n<h2>\n   <a id=\"_33\"><br \/>\n   <\/a><br \/>\n   \u5e93\u7684\u4ecb\u7ecd<br \/>\n  <\/h2>\n<ul>\n<li>\n<h3>\n     Openpyxl\u662f\u4e00\u4e2a\u5f3a\u5927\u7684Python\u5e93\uff0c\u4e3b\u8981\u7528\u4e8e\u8bfb\u53d6\u3001\u5199\u5165\u548c\u64cd\u4f5cExcel\u6587\u4ef6\uff08\u7279\u522b\u662f.xlsx\u683c\u5f0f\uff09\u3002\u5b83\u63d0\u4f9b\u4e86\u4e00\u7ec4\u529f\u80fd\u4e30\u5bcc\u7684API\uff0c\u652f\u6301Excel 2010\u53ca\u66f4\u9ad8\u7248\u672c\u7684\u6587\u4ef6\u683c\u5f0f\uff0c\u4f7f\u5f97\u5728\u7f16\u7a0b\u4e2d\u5904\u7406Excel\u6587\u4ef6\u53d8\u5f97\u975e\u5e38\u5bb9\u6613\u3002<br \/>\n    <\/h3>\n<\/li>\n<li>\n<h3>\n     Openpyxl\u7684\u4e3b\u8981\u7279\u70b9\u548c\u529f\u80fd\u5305\u62ec\uff1a<br \/>\n    <\/h3>\n<\/li>\n<li>\n<h3>\n     1\u3001\u652f\u6301.xlsx\u683c\u5f0f\uff1aOpenpyxl\u4e3b\u8981\u7528\u4e8e\u5904\u7406Excel 2010\u53ca\u66f4\u65b0\u7248\u672c\u7684.xlsx\u6587\u4ef6\u3002<br \/>\n    <\/h3>\n<\/li>\n<li>\n<h3>\n     2\u3001\u8bfb\u5199Excel\u6587\u4ef6\uff1a\u7528\u6237\u53ef\u4ee5\u4f7f\u7528Openpyxl\u8bfb\u53d6\u73b0\u6709\u7684Excel\u6587\u4ef6\uff0c\u83b7\u53d6\u6570\u636e\uff0c\u4fee\u6539\u6570\u636e\uff0c\u5e76\u4fdd\u5b58\u5230\u65b0\u7684\u6587\u4ef6\u4e2d\u3002<br \/>\n    <\/h3>\n<\/li>\n<li>\n<h3>\n     3\u3001\u64cd\u4f5c\u5355\u5143\u683c\uff1aOpenpyxl\u5141\u8bb8\u7528\u6237\u6309\u884c\u3001\u5217\u6216\u5177\u4f53\u7684\u5355\u5143\u683c\u8fdb\u884c\u6570\u636e\u7684\u8bfb\u53d6\u548c\u5199\u5165\u3002<br \/>\n    <\/h3>\n<\/li>\n<li>\n<h3>\n     4\u3001\u521b\u5efa\u548c\u4fee\u6539\u5de5\u4f5c\u8868\uff1a\u7528\u6237\u53ef\u4ee5\u521b\u5efa\u65b0\u7684\u5de5\u4f5c\u8868\uff0c\u590d\u5236\u548c\u5220\u9664\u73b0\u6709\u7684\u5de5\u4f5c\u8868\uff0c\u4ee5\u53ca\u8bbe\u7f6e\u5de5\u4f5c\u8868\u7684\u5c5e\u6027\u7b49\u3002<br \/>\n    <\/h3>\n<\/li>\n<li>\n<h3>\n     5\u3001\u6837\u5f0f\u8bbe\u7f6e\uff1aOpenpyxl\u5141\u8bb8\u7528\u6237\u8bbe\u7f6e\u5355\u5143\u683c\u7684\u5b57\u4f53\u3001\u989c\u8272\u3001\u8fb9\u6846\u7b49\u6837\u5f0f\u3002<br \/>\n    <\/h3>\n<\/li>\n<li>\n<h3>\n     6\u3001\u56fe\u8868\u548c\u516c\u5f0f\uff1a\u7528\u6237\u53ef\u4ee5\u901a\u8fc7Openpyxl\u521b\u5efa\u56fe\u8868\u3001\u6dfb\u52a0\u516c\u5f0f\u7b49\u3002<br \/>\n    <\/h3>\n<\/li>\n<li>\n<h3>\n     7\u3001\u652f\u6301\u6570\u5b57\u548c\u65e5\u671f\u683c\u5f0f\uff1aOpenpyxl\u80fd\u591f\u6b63\u786e\u5904\u7406\u6570\u5b57\u548c\u65e5\u671f\u683c\u5f0f\uff0c\u786e\u4fdd\u5728Excel\u4e2d\u663e\u793a\u6b63\u786e\u7684\u683c\u5f0f\u3002<br \/>\n    <\/h3>\n<\/li>\n<\/ul>\n<h3>\n   \u5728Openpyxl\u4e2d\uff0c\u6709\u4e09\u4e2a\u4e3b\u8981\u7684\u5bf9\u8c61\uff1aWorkbook\u3001Worksheet\u548cCell\u3002Workbook\u4ee3\u8868\u4e00\u4e2aExcel\u6587\u6863\uff0cWorksheet\u4ee3\u8868\u8868\u683c\uff0cCell\u5219\u4ee3\u8868\u5355\u5143\u683c\u3002\u8fd9\u4e9b\u5bf9\u8c61\u90fd\u5305\u542b\u4e86\u8bb8\u591a\u5c5e\u6027\u548c\u65b9\u6cd5\uff0c\u65b9\u4fbf\u7528\u6237\u8fdb\u884c\u5404\u79cd\u64cd\u4f5c\u3002<br \/>\n  <\/h3>\n<h3>\n   \u5b89\u88c5\u548c\u5bfc\u5165Openpyxl\u4e5f\u76f8\u5bf9\u7b80\u5355\u3002\u7528\u6237\u53ef\u4ee5\u4f7f\u7528pip\u8fdb\u884c\u5b89\u88c5\uff0c\u7136\u540e\u5728Python\u7a0b\u5e8f\u4e2d\u901a\u8fc7import\u8bed\u53e5\u5bfc\u5165\u6574\u4e2a\u5e93\u6216\u7279\u5b9a\u7684\u6a21\u5757\u548c\u51fd\u6570\u3002<br \/>\n  <\/h3>\n<h3>\n   \u603b\u7684\u6765\u8bf4\uff0cOpenpyxl\u662f\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u3001\u6613\u4e8e\u4f7f\u7528\u7684Python\u5e93\uff0c\u53ef\u4ee5\u5927\u5927\u63d0\u9ad8\u5904\u7406Excel\u6587\u4ef6\u7684\u6548\u7387\u3002\u65e0\u8bba\u662f\u81ea\u52a8\u5316\u5904\u7406\u5927\u91cf\u6570\u636e\uff0c\u8fd8\u662f\u521b\u5efa\u6f02\u4eae\u7684\u62a5\u544a\uff0cOpenpyxl\u90fd\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u5de5\u5177\u3002<br \/>\n  <\/h3>\n<h2>\n   <a id=\"_51\"><br \/>\n   <\/a><br \/>\n   \u5e93\u7684\u5b89\u88c5<br \/>\n  <\/h2>\n<pre><code class=\"prism language-python\">pip install openpyxl <span class=\"token operator\">-<\/span>i https<span class=\"token punctuation\">:<\/span><span class=\"token operator\">\/\/<\/span>pypi<span class=\"token punctuation\">.<\/span>tuna<span class=\"token punctuation\">.<\/span>tsinghua<span class=\"token punctuation\">.<\/span>edu<span class=\"token punctuation\">.<\/span>cn<span class=\"token operator\">\/<\/span>simple<span class=\"token operator\">\/<\/span>\n<\/code><\/pre>\n<h2>\n   \u51c6\u5907\u4e00\u4e2a\u6d4b\u8bd5Excel\u6570\u636e<br \/>\n  <\/h2>\n<\/p>\n<h2>\n   <a id=\"1Excel_63\"><br \/>\n   <\/a><br \/>\n   1\u3001\u8bfb\u53d6Excel\u6587\u4ef6\uff08\u6309\u884c\u8bfb\u53d6\uff09<br \/>\n  <\/h2>\n<pre><code class=\"prism language-python\"><span class=\"token keyword\">import<\/span> openpyxl\n<span class=\"token comment\"># \u6253\u5f00 Excel \u6587\u4ef6\uff0c\u83b7\u53d6 Workbook \u5bf9\u8c61<\/span>\nworkbook <span class=\"token operator\">=<\/span> openpyxl<span class=\"token punctuation\">.<\/span>load_workbook<span class=\"token punctuation\">(<\/span><span class=\"token string\">'.\/text.xlsx'<\/span><span class=\"token punctuation\">,<\/span>read_only<span class=\"token operator\">=<\/span><span class=\"token boolean\">True<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token comment\"># \u9009\u62e9\u9700\u8981\u8bfb\u53d6\u6570\u636e\u7684 Sheet\uff0c\u83b7\u53d6 Worksheet \u5bf9\u8c61<\/span>\nworksheet <span class=\"token operator\">=<\/span> workbook<span class=\"token punctuation\">.<\/span>active\n\n<span class=\"token comment\"># \u5faa\u73af\u904d\u5386\u6bcf\u4e00\u884c\uff0c\u5c06\u6bcf\u4e00\u884c\u7684\u6570\u636e\u4ee5\u5217\u8868\u5f62\u5f0f\u6dfb\u52a0\u5230 rows \u5217\u8868\u4e2d<\/span>\n<span class=\"token keyword\">for<\/span> i<span class=\"token punctuation\">,<\/span> row <span class=\"token keyword\">in<\/span> <span class=\"token builtin\">enumerate<\/span><span class=\"token punctuation\">(<\/span>worksheet<span class=\"token punctuation\">.<\/span>iter_rows<span class=\"token punctuation\">(<\/span>values_only<span class=\"token operator\">=<\/span><span class=\"token boolean\">True<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span>\n    d <span class=\"token operator\">=<\/span> <span class=\"token builtin\">list<\/span><span class=\"token punctuation\">(<\/span>row<span class=\"token punctuation\">)<\/span>\n    <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string-interpolation\"><span class=\"token string\">f\"\u884c<\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<!-- --><\/span>i<span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\">\"<\/span><\/span><span class=\"token punctuation\">,<\/span>d<span class=\"token punctuation\">)<\/span>\n<\/code><\/pre>\n<ul>\n<li>\n<h4>\n     \u8f93\u51fa<br \/>\n    <\/h4>\n<\/li>\n<\/ul>\n<pre><code class=\"prism language-python\">\u884c<span class=\"token number\">1<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token string\">'\u59d3\u540d'<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">'\u73ed\u7ea7'<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">'\u6027\u522b'<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">'\u5e74\u9f84'<\/span><span class=\"token punctuation\">]<\/span>\n\u884c<span class=\"token number\">2<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token string\">'\u5f201'<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">'\u7537'<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">10<\/span><span class=\"token punctuation\">]<\/span>\n\u884c<span class=\"token number\">3<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token string\">'\u5f202'<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">'\u7537'<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">11<\/span><span class=\"token punctuation\">]<\/span>\n\u884c<span class=\"token number\">4<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token string\">'\u5f203'<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">'\u7537'<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">12<\/span><span class=\"token punctuation\">]<\/span>\n\u884c<span class=\"token number\">5<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token string\">'\u5f204'<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">'\u7537'<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">13<\/span><span class=\"token punctuation\">]<\/span>\n\u884c<span class=\"token number\">6<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token string\">'\u5f205'<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">'\u7537'<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">14<\/span><span class=\"token punctuation\">]<\/span>\n\u884c<span class=\"token number\">7<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token string\">'\u5f206'<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">'\u7537'<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">15<\/span><span class=\"token punctuation\">]<\/span>\n\u884c<span class=\"token number\">8<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token string\">'\u5f207'<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">'\u7537'<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">16<\/span><span class=\"token punctuation\">]<\/span>\n\u7565\u7565\u7565\u7565\n<\/code><\/pre>\n<ul>\n<li>\n   <\/li>\n<\/ul>\n<h2>\n   <a id=\"2Excel_92\"><br \/>\n   <\/a><br \/>\n   2\u3001\u8bfb\u53d6Excel\u6587\u4ef6\uff08\u6309\u67d0\u5217\u8bfb\u53d6\uff09<br \/>\n  <\/h2>\n<pre><code class=\"prism language-python\"><span class=\"token keyword\">import<\/span> openpyxl\n<span class=\"token comment\"># \u6253\u5f00 Excel \u6587\u4ef6\uff0c\u83b7\u53d6 Workbook \u5bf9\u8c61<\/span>\nworkbook <span class=\"token operator\">=<\/span> openpyxl<span class=\"token punctuation\">.<\/span>load_workbook<span class=\"token punctuation\">(<\/span><span class=\"token string\">'.\/text.xlsx'<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token comment\"># \u9009\u62e9\u9700\u8981\u8bfb\u53d6\u6570\u636e\u7684 Sheet\uff0c\u83b7\u53d6 Worksheet \u5bf9\u8c61<\/span>\nworksheet <span class=\"token operator\">=<\/span> workbook<span class=\"token punctuation\">.<\/span>active\n\n<span class=\"token comment\"># \u5faa\u73af\u904d\u5386\u6bcf\u4e00\u884c\uff0c\u5c06\u6bcf\u4e00\u884c\u7684\u6570\u636e\u4ee5\u5217\u8868\u5f62\u5f0f\u6dfb\u52a0\u5230 rows \u5217\u8868\u4e2d<\/span>\n<span class=\"token keyword\">for<\/span> i<span class=\"token punctuation\">,<\/span> cell <span class=\"token keyword\">in<\/span> <span class=\"token builtin\">enumerate<\/span><span class=\"token punctuation\">(<\/span>worksheet<span class=\"token punctuation\">[<\/span><span class=\"token string\">\"A\"<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span>\n    <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string-interpolation\"><span class=\"token string\">f\"\u884c<\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<!-- --><\/span>i<span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\">\"<\/span><\/span><span class=\"token punctuation\">,<\/span>cell<span class=\"token punctuation\">.<\/span>value<span class=\"token punctuation\">)<\/span>\n<\/code><\/pre>\n<ul>\n<li>\n<h4>\n     \u8f93\u51fa<br \/>\n    <\/h4>\n<\/li>\n<\/ul>\n<pre><code class=\"prism language-python\">\u884c<span class=\"token number\">1<\/span> \u59d3\u540d\n\u884c<span class=\"token number\">2<\/span> \u5f20<span class=\"token number\">1<\/span>\n\u884c<span class=\"token number\">3<\/span> \u5f20<span class=\"token number\">2<\/span>\n\u884c<span class=\"token number\">4<\/span> \u5f20<span class=\"token number\">3<\/span>\n\u884c<span class=\"token number\">5<\/span> \u5f20<span class=\"token number\">4<\/span>\n\u884c<span class=\"token number\">6<\/span> \u5f20<span class=\"token number\">5<\/span>\n\u884c<span class=\"token number\">7<\/span> \u5f20<span class=\"token number\">6<\/span>\n\u884c<span class=\"token number\">8<\/span> \u5f20<span class=\"token number\">7<\/span>\n\u7565\u7565\n<\/code><\/pre>\n<h2>\n   <a id=\"3_119\"><br \/>\n   <\/a><br \/>\n   3\u3001\u65b0\u589e\u4e00\u5217<br \/>\n  <\/h2>\n<pre><code class=\"prism language-python\"><span class=\"token keyword\">import<\/span> openpyxl\n<span class=\"token comment\"># \u6253\u5f00 Excel \u6587\u4ef6\uff0c\u83b7\u53d6 Workbook \u5bf9\u8c61<\/span>\nworkbook <span class=\"token operator\">=<\/span> openpyxl<span class=\"token punctuation\">.<\/span>load_workbook<span class=\"token punctuation\">(<\/span><span class=\"token string\">'.\/text.xlsx'<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token comment\"># \u9009\u62e9\u9700\u8981\u8bfb\u53d6\u6570\u636e\u7684 Sheet\uff0c\u83b7\u53d6 Worksheet \u5bf9\u8c61<\/span>\nworksheet <span class=\"token operator\">=<\/span> workbook<span class=\"token punctuation\">.<\/span>active\n\n<span class=\"token comment\"># \u65b0\u589e\u4e00\u5217<\/span>\nworksheet<span class=\"token punctuation\">.<\/span>insert_cols<span class=\"token punctuation\">(<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span>\n\nworkbook<span class=\"token punctuation\">.<\/span>save<span class=\"token punctuation\">(<\/span><span class=\"token string\">\"\u7ed3\u679c.xlsx\"<\/span><span class=\"token punctuation\">)<\/span>\n<\/code><\/pre>\n<ul>\n<li>\n<h4>\n     \u8f93\u51fa<br \/>\n    <\/h4>\n<\/li>\n<\/ul>\n<h2>\n   <a id=\"4_136\"><br \/>\n   <\/a><br \/>\n   4\u3001\u5220\u9664\u4e00\u5217<br \/>\n  <\/h2>\n<pre><code class=\"prism language-python\"><span class=\"token keyword\">import<\/span> openpyxl\n<span class=\"token keyword\">from<\/span> openpyxl<span class=\"token punctuation\">.<\/span>styles <span class=\"token keyword\">import<\/span> Font\n\n<span class=\"token comment\"># \u6253\u5f00 Excel \u6587\u4ef6\uff0c\u83b7\u53d6 Workbook \u5bf9\u8c61<\/span>\nworkbook <span class=\"token operator\">=<\/span> openpyxl<span class=\"token punctuation\">.<\/span>load_workbook<span class=\"token punctuation\">(<\/span><span class=\"token string\">'.\/text.xlsx'<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token comment\"># \u9009\u62e9\u9700\u8981\u8bfb\u53d6\u6570\u636e\u7684 Sheet\uff0c\u83b7\u53d6 Worksheet \u5bf9\u8c61<\/span>\nworksheet <span class=\"token operator\">=<\/span> workbook<span class=\"token punctuation\">.<\/span>active\n\n<span class=\"token comment\"># \u5220\u9664B\u5217<\/span>\n<span class=\"token keyword\">for<\/span> row <span class=\"token keyword\">in<\/span> worksheet<span class=\"token punctuation\">.<\/span>iter_rows<span class=\"token punctuation\">(<\/span>min_row<span class=\"token operator\">=<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">,<\/span> max_row<span class=\"token operator\">=<\/span>worksheet<span class=\"token punctuation\">.<\/span>max_row<span class=\"token punctuation\">,<\/span> min_col<span class=\"token operator\">=<\/span><span class=\"token number\">2<\/span><span class=\"token punctuation\">,<\/span> max_col<span class=\"token operator\">=<\/span><span class=\"token number\">2<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span>\n    <span class=\"token keyword\">for<\/span> cell <span class=\"token keyword\">in<\/span> row<span class=\"token punctuation\">:<\/span>\n        cell<span class=\"token punctuation\">.<\/span>value <span class=\"token operator\">=<\/span> <span class=\"token boolean\">None<\/span>\n\n\nworkbook<span class=\"token punctuation\">.<\/span>save<span class=\"token punctuation\">(<\/span><span class=\"token string\">\"\u7ed3\u679c.xlsx\"<\/span><span class=\"token punctuation\">)<\/span>\n\n\n<\/code><\/pre>\n<ul>\n<li>\n<h4>\n     \u8f93\u51fa<br \/>\n    <\/h4>\n<\/li>\n<li>\n   <\/li>\n<\/ul>\n<h2>\n   <a id=\"5_161\"><br \/>\n   <\/a><br \/>\n   5\u3001\u63d2\u5165\u4e00\u884c<br \/>\n  <\/h2>\n<pre><code class=\"prism language-python\"><span class=\"token keyword\">import<\/span> openpyxl\n<span class=\"token comment\"># \u6253\u5f00 Excel \u6587\u4ef6\uff0c\u83b7\u53d6 Workbook \u5bf9\u8c61<\/span>\nworkbook <span class=\"token operator\">=<\/span> openpyxl<span class=\"token punctuation\">.<\/span>load_workbook<span class=\"token punctuation\">(<\/span><span class=\"token string\">'.\/text.xlsx'<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token comment\"># \u9009\u62e9\u9700\u8981\u8bfb\u53d6\u6570\u636e\u7684 Sheet\uff0c\u83b7\u53d6 Worksheet \u5bf9\u8c61<\/span>\nworksheet <span class=\"token operator\">=<\/span> workbook<span class=\"token punctuation\">.<\/span>active\n\n<span class=\"token comment\"># \u5728\u7b2c\u4e09\u884c\u63d2\u5165\u4e00\u884c<\/span>\nworksheet<span class=\"token punctuation\">.<\/span>insert_rows<span class=\"token punctuation\">(<\/span><span class=\"token number\">3<\/span><span class=\"token punctuation\">)<\/span>\n\nworkbook<span class=\"token punctuation\">.<\/span>save<span class=\"token punctuation\">(<\/span><span class=\"token string\">\"\u7ed3\u679c.xlsx\"<\/span><span class=\"token punctuation\">)<\/span>\n<\/code><\/pre>\n<ul>\n<li>\n<h4>\n     \u8f93\u51fa<br \/>\n    <\/h4>\n<\/li>\n<\/ul>\n<h2>\n   <a id=\"6_177\"><br \/>\n   <\/a><br \/>\n   6\u3001\u5220\u9664\u4e00\u884c<br \/>\n  <\/h2>\n<pre><code class=\"prism language-python\"><span class=\"token keyword\">import<\/span> openpyxl\n<span class=\"token keyword\">from<\/span> openpyxl<span class=\"token punctuation\">.<\/span>styles <span class=\"token keyword\">import<\/span> Font\n\n<span class=\"token comment\"># \u6253\u5f00 Excel \u6587\u4ef6\uff0c\u83b7\u53d6 Workbook \u5bf9\u8c61<\/span>\nworkbook <span class=\"token operator\">=<\/span> openpyxl<span class=\"token punctuation\">.<\/span>load_workbook<span class=\"token punctuation\">(<\/span><span class=\"token string\">'.\/text.xlsx'<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token comment\"># \u9009\u62e9\u9700\u8981\u8bfb\u53d6\u6570\u636e\u7684 Sheet\uff0c\u83b7\u53d6 Worksheet \u5bf9\u8c61<\/span>\nworksheet <span class=\"token operator\">=<\/span> workbook<span class=\"token punctuation\">.<\/span>active\n\n<span class=\"token comment\"># \u5220\u7b2c5\u884c<\/span>\nworksheet<span class=\"token punctuation\">.<\/span>delete_rows<span class=\"token punctuation\">(<\/span><span class=\"token number\">5<\/span><span class=\"token punctuation\">)<\/span>\n\nworkbook<span class=\"token punctuation\">.<\/span>save<span class=\"token punctuation\">(<\/span><span class=\"token string\">\"\u7ed3\u679c.xlsx\"<\/span><span class=\"token punctuation\">)<\/span>\n<\/code><\/pre>\n<ul>\n<li>\n<h4>\n     \u8f93\u51fa<br \/>\n    <\/h4>\n<\/li>\n<\/ul>\n<h2>\n   <a id=\"7_198\"><br \/>\n   <\/a><br \/>\n   7\u3001\u4fee\u6539\u5355\u5143\u683c\u503c<br \/>\n  <\/h2>\n<pre><code class=\"prism language-python\"><span class=\"token keyword\">import<\/span> openpyxl\n<span class=\"token comment\"># \u6253\u5f00 Excel \u6587\u4ef6\uff0c\u83b7\u53d6 Workbook \u5bf9\u8c61<\/span>\nworkbook <span class=\"token operator\">=<\/span> openpyxl<span class=\"token punctuation\">.<\/span>load_workbook<span class=\"token punctuation\">(<\/span><span class=\"token string\">'.\/text.xlsx'<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token comment\"># \u9009\u62e9\u9700\u8981\u8bfb\u53d6\u6570\u636e\u7684 Sheet\uff0c\u83b7\u53d6 Worksheet \u5bf9\u8c61<\/span>\nworksheet <span class=\"token operator\">=<\/span> workbook<span class=\"token punctuation\">.<\/span>active\n\n<span class=\"token comment\"># \u5c06A1 \u5355\u5143\u683c\u4fee\u6539\u4e3a\uff1a\u54c8\u54c8<\/span>\nworksheet<span class=\"token punctuation\">[<\/span><span class=\"token string\">'A1'<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">=<\/span> <span class=\"token string\">'\u54c8\u54c8'<\/span>\n\nworkbook<span class=\"token punctuation\">.<\/span>save<span class=\"token punctuation\">(<\/span><span class=\"token string\">\"\u7ed3\u679c.xlsx\"<\/span><span class=\"token punctuation\">)<\/span>\n<\/code><\/pre>\n<ul>\n<li>\n<h4>\n     \u8f93\u51fa<br \/>\n    <\/h4>\n<\/li>\n<\/ul>\n<h2>\n   <a id=\"8_216\"><br \/>\n   <\/a><br \/>\n   8\u3001\u4fee\u6539\u5355\u5143\u5e95\u8272<br \/>\n  <\/h2>\n<pre><code class=\"prism language-python\"><span class=\"token keyword\">import<\/span> openpyxl\n<span class=\"token comment\"># \u6253\u5f00 Excel \u6587\u4ef6\uff0c\u83b7\u53d6 Workbook \u5bf9\u8c61<\/span>\nworkbook <span class=\"token operator\">=<\/span> openpyxl<span class=\"token punctuation\">.<\/span>load_workbook<span class=\"token punctuation\">(<\/span><span class=\"token string\">'.\/text.xlsx'<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token comment\"># \u9009\u62e9\u9700\u8981\u8bfb\u53d6\u6570\u636e\u7684 Sheet\uff0c\u83b7\u53d6 Worksheet \u5bf9\u8c61<\/span>\nworksheet <span class=\"token operator\">=<\/span> workbook<span class=\"token punctuation\">.<\/span>active\n\n<span class=\"token comment\"># \u5c06\u7b2c\u4e00\u884c\u5355\u5143\u683c\u5e95\u8272\u4fee\u6539\u4e3a\u6a59\u8272<\/span>\n<span class=\"token keyword\">for<\/span> cell <span class=\"token keyword\">in<\/span> worksheet<span class=\"token punctuation\">[<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">:<\/span>\n    cell<span class=\"token punctuation\">.<\/span>fill <span class=\"token operator\">=<\/span> openpyxl<span class=\"token punctuation\">.<\/span>styles<span class=\"token punctuation\">.<\/span>PatternFill<span class=\"token punctuation\">(<\/span>start_color<span class=\"token operator\">=<\/span><span class=\"token string\">'FFC000'<\/span><span class=\"token punctuation\">,<\/span> end_color<span class=\"token operator\">=<\/span><span class=\"token string\">'FFC000'<\/span><span class=\"token punctuation\">,<\/span> fill_type<span class=\"token operator\">=<\/span><span class=\"token string\">'solid'<\/span><span class=\"token punctuation\">)<\/span>\n\n\nworkbook<span class=\"token punctuation\">.<\/span>save<span class=\"token punctuation\">(<\/span><span class=\"token string\">\"\u7ed3\u679c.xlsx\"<\/span><span class=\"token punctuation\">)<\/span>\n<\/code><\/pre>\n<ul>\n<li>\n<h4>\n     \u8f93\u51fa<br \/>\n    <\/h4>\n<\/li>\n<\/ul>\n<h2>\n   <a id=\"9_237\"><br \/>\n   <\/a><br \/>\n   9\u3001\u4fee\u6539\u5355\u5143\u683c\u5b57\u4f53<br \/>\n  <\/h2>\n<pre><code class=\"prism language-python\"><span class=\"token keyword\">import<\/span> openpyxl\n<span class=\"token keyword\">from<\/span> openpyxl<span class=\"token punctuation\">.<\/span>styles <span class=\"token keyword\">import<\/span> Font\n<span class=\"token comment\"># \u8bbe\u7f6e\u5b57\u4f53\u5bf9\u8c61<\/span>\nfont <span class=\"token operator\">=<\/span> Font<span class=\"token punctuation\">(<\/span>name<span class=\"token operator\">=<\/span><span class=\"token string\">'\u5fae\u8f6f\u96c5\u9ed1'<\/span><span class=\"token punctuation\">,<\/span> size<span class=\"token operator\">=<\/span><span class=\"token number\">10<\/span><span class=\"token punctuation\">,<\/span> bold<span class=\"token operator\">=<\/span><span class=\"token boolean\">True<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token comment\"># \u6253\u5f00 Excel \u6587\u4ef6\uff0c\u83b7\u53d6 Workbook \u5bf9\u8c61<\/span>\nworkbook <span class=\"token operator\">=<\/span> openpyxl<span class=\"token punctuation\">.<\/span>load_workbook<span class=\"token punctuation\">(<\/span><span class=\"token string\">'.\/text.xlsx'<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token comment\"># \u9009\u62e9\u9700\u8981\u8bfb\u53d6\u6570\u636e\u7684 Sheet\uff0c\u83b7\u53d6 Worksheet \u5bf9\u8c61<\/span>\nworksheet <span class=\"token operator\">=<\/span> workbook<span class=\"token punctuation\">.<\/span>active\n\n<span class=\"token comment\"># \u5c06\u7b2c\u4e00\u884c\u5b57\u4f53\u8bbe\u7f6e\u4e3a\uff1a\u5fae\u8f6f\u96c5\u9ed110\u53f7\u52a0\u7c97<\/span>\n<span class=\"token keyword\">for<\/span> cell <span class=\"token keyword\">in<\/span> worksheet<span class=\"token punctuation\">[<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">:<\/span>\n    cell<span class=\"token punctuation\">.<\/span>font <span class=\"token operator\">=<\/span> font\n    \nworkbook<span class=\"token punctuation\">.<\/span>save<span class=\"token punctuation\">(<\/span><span class=\"token string\">\"\u7ed3\u679c.xlsx\"<\/span><span class=\"token punctuation\">)<\/span>\n<\/code><\/pre>\n<ul>\n<li>\n<h4>\n     \u8f93\u51fa<br \/>\n    <\/h4>\n<\/li>\n<li>\n   <\/li>\n<\/ul>\n<h2>\n   <a id=\"10sheet_sheet_259\"><br \/>\n   <\/a><br \/>\n   10\u3001\u83b7\u53d6sheet\u8868 \u5207\u6362sheet\u8868<br \/>\n  <\/h2>\n<pre><code class=\"prism language-python\"><span class=\"token keyword\">import<\/span> openpyxl\n<span class=\"token keyword\">from<\/span> openpyxl<span class=\"token punctuation\">.<\/span>styles <span class=\"token keyword\">import<\/span> Font\n\n<span class=\"token comment\"># \u6253\u5f00 Excel \u6587\u4ef6\uff0c\u83b7\u53d6 Workbook \u5bf9\u8c61<\/span>\nworkbook <span class=\"token operator\">=<\/span> openpyxl<span class=\"token punctuation\">.<\/span>load_workbook<span class=\"token punctuation\">(<\/span><span class=\"token string\">'.\/text.xlsx'<\/span><span class=\"token punctuation\">)<\/span>\n<span class=\"token comment\"># \u9009\u62e9\u9700\u8981\u8bfb\u53d6\u6570\u636e\u7684 Sheet\uff0c\u83b7\u53d6 Worksheet \u5bf9\u8c61<\/span>\nworksheet <span class=\"token operator\">=<\/span> workbook<span class=\"token punctuation\">.<\/span>active\n\n<span class=\"token comment\"># \u83b7\u53d6\u6240\u6709sheet\u8868<\/span>\n<span class=\"token keyword\">for<\/span> sheet <span class=\"token keyword\">in<\/span> workbook<span class=\"token punctuation\">.<\/span>sheetnames<span class=\"token punctuation\">:<\/span>\n    <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>sheet<span class=\"token punctuation\">)<\/span>\n    <span class=\"token comment\"># \u5207\u6362heet<\/span>\n    worksheet <span class=\"token operator\">=<\/span> workbook<span class=\"token punctuation\">[<\/span>sheet<span class=\"token punctuation\">]<\/span>\n    <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">\"\u6b63\u5728\u5904\u7406\uff1a\"<\/span><span class=\"token punctuation\">,<\/span> sheet<span class=\"token punctuation\">)<\/span>\n\n\nworkbook<span class=\"token punctuation\">.<\/span>save<span class=\"token punctuation\">(<\/span><span class=\"token string\">\"\u7ed3\u679c.xlsx\"<\/span><span class=\"token punctuation\">)<\/span>\n<\/code><\/pre>\n<ul>\n<li>\n<h4>\n     \u8f93\u51fa<br \/>\n    <\/h4>\n<\/li>\n<\/ul>\n<pre><code class=\"prism language-python\">Sheet1\n\u6b63\u5728\u5904\u7406\uff1a Sheet1\nSheet2\n\u6b63\u5728\u5904\u7406\uff1a Sheet2\n<\/code><\/pre>\n<h2>\n   <a id=\"_289\"><br \/>\n   <\/a><br \/>\n   \u603b\u7ed3<br \/>\n  <\/h2>\n<ul>\n<li>\n<h3>\n     \u5e0c\u671b\u5bf9\u521d\u5b66\u8005\u6709\u5e2e\u52a9<br \/>\n    <\/h3>\n<\/li>\n<li>\n<h3>\n     \u81f4\u529b\u4e8e\u529e\u516c\u81ea\u52a8\u5316\u7684\u5c0f\u5c0f\u7a0b\u5e8f\u5458\u4e00\u679a<br \/>\n    <\/h3>\n<\/li>\n<li>\n<h3>\n     \u5e0c\u671b\u80fd\u5f97\u5230\u5927\u5bb6\u7684\u3010\u4e00\u4e2a\u514d\u8d39\u5173\u6ce8\u3011\uff01\u611f\u8c22<br \/>\n    <\/h3>\n<\/li>\n<li>\n<h3>\n     \u6c42\u4e2a \ud83e\udd1e \u5173\u6ce8 \ud83e\udd1e<br \/>\n    <\/h3>\n<\/li>\n<li>\n<h3>\n     \u6b64\u5916\u8fd8\u6709\u529e\u516c\u81ea\u52a8\u5316\u4e13\u680f\uff0c\u6b22\u8fce\u5927\u5bb6\u8ba2\u9605\uff1a<br \/>\n     <a href=\"https:\/\/blog.csdn.net\/weixin_42636075\/category_8127739.html?spm=1001.2014.3001.5482\"><br \/>\n      Python\u529e\u516c\u81ea\u52a8\u5316\u4e13\u680f<br \/>\n     <\/a><br \/>\n    <\/h3>\n<\/li>\n<li>\n<h3>\n     \u6c42\u4e2a \u2764\ufe0f \u559c\u6b22 \u2764\ufe0f<br \/>\n    <\/h3>\n<\/li>\n<li>\n<h3>\n     \u6b64\u5916\u8fd8\u6709\u722c\u866b\u4e13\u680f\uff0c\u6b22\u8fce\u5927\u5bb6\u8ba2\u9605\uff1a<br \/>\n     <a href=\"https:\/\/blog.csdn.net\/weixin_42636075\/category_11978272.html\"><br \/>\n      Python\u722c\u866b\u57fa\u7840\u4e13\u680f<br \/>\n     <\/a><br \/>\n    <\/h3>\n<\/li>\n<li>\n<h3>\n     \u6c42\u4e2a \ud83d\udc4d \u6536\u85cf \ud83d\udc4d<br \/>\n    <\/h3>\n<\/li>\n<li>\n<h3>\n     \u6b64\u5916\u8fd8\u6709Python\u57fa\u7840\u4e13\u680f\uff0c\u6b22\u8fce\u5927\u5bb6\u8ba2\u9605\uff1a<br \/>\n     <a href=\"https:\/\/blog.csdn.net\/weixin_42636075\/category_12434374.html?spm=1001.2014.3001.5482\"><br \/>\n      Python\u57fa\u7840\u5b66\u4e60\u4e13\u680f<br \/>\n     <\/a><br \/>\n    <\/h3>\n<\/li>\n<\/ul><\/div>\n<link href=\"https:\/\/csdnimg.cn\/release\/blogv2\/dist\/mdeditor\/css\/editerView\/markdown_views-a5d25dd831.css\" rel=\"stylesheet\"\/>\n <link href=\"https:\/\/csdnimg.cn\/release\/blogv2\/dist\/mdeditor\/css\/style-e504d6a974.css\" rel=\"stylesheet\"\/>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u76ee\u5f55 \u4e13\u680f\u5bfc\u8bfb \u5e93\u7684\u4ecb\u7ecd \u5e93\u7684\u5b89\u88c5 1\u3001\u8bfb\u53d6Excel\u6587\u4ef6\uff08\u6309\u884c\u8bfb\u53d6\uff09 2\u3001\u8bfb\u53d6Excel\u6587\u4ef6\uff08\u6309\u67d0\u5217\u8bfb\u53d6\uff09  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":215,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-2476","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-18"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Python\u529e\u516c\u2014openpyxl(\u589e\u52a0\u3001\u5220\u9664\u884c\u5217\uff0c\u4fee\u6539\u5355\u5143\u683c\uff0c\u5e95\u8272\u3001\u5b57\u4f53\u6837\u5f0f\u8bbe\u7f6e\uff0c\u8bfb\u53d6sheet\u8868) - \u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/www.wunen.com\/index.php\/2025\/05\/20\/python\u529e\u516c-openpyxl\u589e\u52a0\u3001\u5220\u9664\u884c\u5217\uff0c\u4fee\u6539\u5355\u5143\u683c\uff0c\u5e95\u8272\u3001\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python\u529e\u516c\u2014openpyxl(\u589e\u52a0\u3001\u5220\u9664\u884c\u5217\uff0c\u4fee\u6539\u5355\u5143\u683c\uff0c\u5e95\u8272\u3001\u5b57\u4f53\u6837\u5f0f\u8bbe\u7f6e\uff0c\u8bfb\u53d6sheet\u8868) - \u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51\" \/>\n<meta property=\"og:description\" content=\"\u76ee\u5f55 \u4e13\u680f\u5bfc\u8bfb \u5e93\u7684\u4ecb\u7ecd \u5e93\u7684\u5b89\u88c5 1\u3001\u8bfb\u53d6Excel\u6587\u4ef6\uff08\u6309\u884c\u8bfb\u53d6\uff09 2\u3001\u8bfb\u53d6Excel\u6587\u4ef6\uff08\u6309\u67d0\u5217\u8bfb\u53d6\uff09 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"http:\/\/www.wunen.com\/index.php\/2025\/05\/20\/python\u529e\u516c-openpyxl\u589e\u52a0\u3001\u5220\u9664\u884c\u5217\uff0c\u4fee\u6539\u5355\u5143\u683c\uff0c\u5e95\u8272\u3001\/\" \/>\n<meta property=\"og:site_name\" content=\"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-19T16:00:11+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"260\" \/>\n\t<meta property=\"og:image:height\" content=\"180\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"admin@wunen\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin@wunen\" \/>\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\":\"http:\/\/www.wunen.com\/index.php\/2025\/05\/20\/python%e5%8a%9e%e5%85%ac-openpyxl%e5%a2%9e%e5%8a%a0%e3%80%81%e5%88%a0%e9%99%a4%e8%a1%8c%e5%88%97%ef%bc%8c%e4%bf%ae%e6%94%b9%e5%8d%95%e5%85%83%e6%a0%bc%ef%bc%8c%e5%ba%95%e8%89%b2%e3%80%81\/#article\",\"isPartOf\":{\"@id\":\"http:\/\/www.wunen.com\/index.php\/2025\/05\/20\/python%e5%8a%9e%e5%85%ac-openpyxl%e5%a2%9e%e5%8a%a0%e3%80%81%e5%88%a0%e9%99%a4%e8%a1%8c%e5%88%97%ef%bc%8c%e4%bf%ae%e6%94%b9%e5%8d%95%e5%85%83%e6%a0%bc%ef%bc%8c%e5%ba%95%e8%89%b2%e3%80%81\/\"},\"author\":{\"name\":\"admin@wunen\",\"@id\":\"http:\/\/www.wunen.com\/#\/schema\/person\/d5f7a6cf545656a9c90d507e64452db8\"},\"headline\":\"Python\u529e\u516c\u2014openpyxl(\u589e\u52a0\u3001\u5220\u9664\u884c\u5217\uff0c\u4fee\u6539\u5355\u5143\u683c\uff0c\u5e95\u8272\u3001\u5b57\u4f53\u6837\u5f0f\u8bbe\u7f6e\uff0c\u8bfb\u53d6sheet\u8868)\",\"datePublished\":\"2025-05-19T16:00:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/www.wunen.com\/index.php\/2025\/05\/20\/python%e5%8a%9e%e5%85%ac-openpyxl%e5%a2%9e%e5%8a%a0%e3%80%81%e5%88%a0%e9%99%a4%e8%a1%8c%e5%88%97%ef%bc%8c%e4%bf%ae%e6%94%b9%e5%8d%95%e5%85%83%e6%a0%bc%ef%bc%8c%e5%ba%95%e8%89%b2%e3%80%81\/\"},\"wordCount\":177,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\/\/www.wunen.com\/#organization\"},\"image\":{\"@id\":\"http:\/\/www.wunen.com\/index.php\/2025\/05\/20\/python%e5%8a%9e%e5%85%ac-openpyxl%e5%a2%9e%e5%8a%a0%e3%80%81%e5%88%a0%e9%99%a4%e8%a1%8c%e5%88%97%ef%bc%8c%e4%bf%ae%e6%94%b9%e5%8d%95%e5%85%83%e6%a0%bc%ef%bc%8c%e5%ba%95%e8%89%b2%e3%80%81\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg\",\"articleSection\":[\"\u5b66\u4e60\u529e\u516c\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\/\/www.wunen.com\/index.php\/2025\/05\/20\/python%e5%8a%9e%e5%85%ac-openpyxl%e5%a2%9e%e5%8a%a0%e3%80%81%e5%88%a0%e9%99%a4%e8%a1%8c%e5%88%97%ef%bc%8c%e4%bf%ae%e6%94%b9%e5%8d%95%e5%85%83%e6%a0%bc%ef%bc%8c%e5%ba%95%e8%89%b2%e3%80%81\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/www.wunen.com\/index.php\/2025\/05\/20\/python%e5%8a%9e%e5%85%ac-openpyxl%e5%a2%9e%e5%8a%a0%e3%80%81%e5%88%a0%e9%99%a4%e8%a1%8c%e5%88%97%ef%bc%8c%e4%bf%ae%e6%94%b9%e5%8d%95%e5%85%83%e6%a0%bc%ef%bc%8c%e5%ba%95%e8%89%b2%e3%80%81\/\",\"url\":\"http:\/\/www.wunen.com\/index.php\/2025\/05\/20\/python%e5%8a%9e%e5%85%ac-openpyxl%e5%a2%9e%e5%8a%a0%e3%80%81%e5%88%a0%e9%99%a4%e8%a1%8c%e5%88%97%ef%bc%8c%e4%bf%ae%e6%94%b9%e5%8d%95%e5%85%83%e6%a0%bc%ef%bc%8c%e5%ba%95%e8%89%b2%e3%80%81\/\",\"name\":\"Python\u529e\u516c\u2014openpyxl(\u589e\u52a0\u3001\u5220\u9664\u884c\u5217\uff0c\u4fee\u6539\u5355\u5143\u683c\uff0c\u5e95\u8272\u3001\u5b57\u4f53\u6837\u5f0f\u8bbe\u7f6e\uff0c\u8bfb\u53d6sheet\u8868) - \u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51\",\"isPartOf\":{\"@id\":\"http:\/\/www.wunen.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/www.wunen.com\/index.php\/2025\/05\/20\/python%e5%8a%9e%e5%85%ac-openpyxl%e5%a2%9e%e5%8a%a0%e3%80%81%e5%88%a0%e9%99%a4%e8%a1%8c%e5%88%97%ef%bc%8c%e4%bf%ae%e6%94%b9%e5%8d%95%e5%85%83%e6%a0%bc%ef%bc%8c%e5%ba%95%e8%89%b2%e3%80%81\/#primaryimage\"},\"image\":{\"@id\":\"http:\/\/www.wunen.com\/index.php\/2025\/05\/20\/python%e5%8a%9e%e5%85%ac-openpyxl%e5%a2%9e%e5%8a%a0%e3%80%81%e5%88%a0%e9%99%a4%e8%a1%8c%e5%88%97%ef%bc%8c%e4%bf%ae%e6%94%b9%e5%8d%95%e5%85%83%e6%a0%bc%ef%bc%8c%e5%ba%95%e8%89%b2%e3%80%81\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg\",\"datePublished\":\"2025-05-19T16:00:11+00:00\",\"breadcrumb\":{\"@id\":\"http:\/\/www.wunen.com\/index.php\/2025\/05\/20\/python%e5%8a%9e%e5%85%ac-openpyxl%e5%a2%9e%e5%8a%a0%e3%80%81%e5%88%a0%e9%99%a4%e8%a1%8c%e5%88%97%ef%bc%8c%e4%bf%ae%e6%94%b9%e5%8d%95%e5%85%83%e6%a0%bc%ef%bc%8c%e5%ba%95%e8%89%b2%e3%80%81\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/www.wunen.com\/index.php\/2025\/05\/20\/python%e5%8a%9e%e5%85%ac-openpyxl%e5%a2%9e%e5%8a%a0%e3%80%81%e5%88%a0%e9%99%a4%e8%a1%8c%e5%88%97%ef%bc%8c%e4%bf%ae%e6%94%b9%e5%8d%95%e5%85%83%e6%a0%bc%ef%bc%8c%e5%ba%95%e8%89%b2%e3%80%81\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"http:\/\/www.wunen.com\/index.php\/2025\/05\/20\/python%e5%8a%9e%e5%85%ac-openpyxl%e5%a2%9e%e5%8a%a0%e3%80%81%e5%88%a0%e9%99%a4%e8%a1%8c%e5%88%97%ef%bc%8c%e4%bf%ae%e6%94%b9%e5%8d%95%e5%85%83%e6%a0%bc%ef%bc%8c%e5%ba%95%e8%89%b2%e3%80%81\/#primaryimage\",\"url\":\"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg\",\"contentUrl\":\"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg\",\"width\":260,\"height\":180},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/www.wunen.com\/index.php\/2025\/05\/20\/python%e5%8a%9e%e5%85%ac-openpyxl%e5%a2%9e%e5%8a%a0%e3%80%81%e5%88%a0%e9%99%a4%e8%a1%8c%e5%88%97%ef%bc%8c%e4%bf%ae%e6%94%b9%e5%8d%95%e5%85%83%e6%a0%bc%ef%bc%8c%e5%ba%95%e8%89%b2%e3%80%81\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"http:\/\/www.wunen.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python\u529e\u516c\u2014openpyxl(\u589e\u52a0\u3001\u5220\u9664\u884c\u5217\uff0c\u4fee\u6539\u5355\u5143\u683c\uff0c\u5e95\u8272\u3001\u5b57\u4f53\u6837\u5f0f\u8bbe\u7f6e\uff0c\u8bfb\u53d6sheet\u8868)\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/www.wunen.com\/#website\",\"url\":\"http:\/\/www.wunen.com\/\",\"name\":\"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51\",\"description\":\"\u8f6f\u4ef6\u8d44\u8baf\u6765\u7269\u5ae9\",\"publisher\":{\"@id\":\"http:\/\/www.wunen.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/www.wunen.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Organization\",\"@id\":\"http:\/\/www.wunen.com\/#organization\",\"name\":\"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51\",\"url\":\"http:\/\/www.wunen.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"http:\/\/www.wunen.com\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/cropped-\u7269\u5ae9-1.png\",\"contentUrl\":\"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/cropped-\u7269\u5ae9-1.png\",\"width\":1024,\"height\":1024,\"caption\":\"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51\"},\"image\":{\"@id\":\"http:\/\/www.wunen.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"http:\/\/www.wunen.com\/#\/schema\/person\/d5f7a6cf545656a9c90d507e64452db8\",\"name\":\"admin@wunen\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"http:\/\/www.wunen.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d90ec1e3faf77c4d4e66e40c29b85ff6401161e0502f401dae2f0e25b38ce25e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d90ec1e3faf77c4d4e66e40c29b85ff6401161e0502f401dae2f0e25b38ce25e?s=96&d=mm&r=g\",\"caption\":\"admin@wunen\"},\"sameAs\":[\"http:\/\/www.wunen.com\"],\"url\":\"http:\/\/www.wunen.com\/index.php\/author\/adminwunen\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python\u529e\u516c\u2014openpyxl(\u589e\u52a0\u3001\u5220\u9664\u884c\u5217\uff0c\u4fee\u6539\u5355\u5143\u683c\uff0c\u5e95\u8272\u3001\u5b57\u4f53\u6837\u5f0f\u8bbe\u7f6e\uff0c\u8bfb\u53d6sheet\u8868) - \u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51","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":"http:\/\/www.wunen.com\/index.php\/2025\/05\/20\/python\u529e\u516c-openpyxl\u589e\u52a0\u3001\u5220\u9664\u884c\u5217\uff0c\u4fee\u6539\u5355\u5143\u683c\uff0c\u5e95\u8272\u3001\/","og_locale":"zh_CN","og_type":"article","og_title":"Python\u529e\u516c\u2014openpyxl(\u589e\u52a0\u3001\u5220\u9664\u884c\u5217\uff0c\u4fee\u6539\u5355\u5143\u683c\uff0c\u5e95\u8272\u3001\u5b57\u4f53\u6837\u5f0f\u8bbe\u7f6e\uff0c\u8bfb\u53d6sheet\u8868) - \u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51","og_description":"\u76ee\u5f55 \u4e13\u680f\u5bfc\u8bfb \u5e93\u7684\u4ecb\u7ecd \u5e93\u7684\u5b89\u88c5 1\u3001\u8bfb\u53d6Excel\u6587\u4ef6\uff08\u6309\u884c\u8bfb\u53d6\uff09 2\u3001\u8bfb\u53d6Excel\u6587\u4ef6\uff08\u6309\u67d0\u5217\u8bfb\u53d6\uff09 [&hellip;]","og_url":"http:\/\/www.wunen.com\/index.php\/2025\/05\/20\/python\u529e\u516c-openpyxl\u589e\u52a0\u3001\u5220\u9664\u884c\u5217\uff0c\u4fee\u6539\u5355\u5143\u683c\uff0c\u5e95\u8272\u3001\/","og_site_name":"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51","article_published_time":"2025-05-19T16:00:11+00:00","og_image":[{"width":260,"height":180,"url":"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg","type":"image\/jpeg"}],"author":"admin@wunen","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin@wunen","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/www.wunen.com\/index.php\/2025\/05\/20\/python%e5%8a%9e%e5%85%ac-openpyxl%e5%a2%9e%e5%8a%a0%e3%80%81%e5%88%a0%e9%99%a4%e8%a1%8c%e5%88%97%ef%bc%8c%e4%bf%ae%e6%94%b9%e5%8d%95%e5%85%83%e6%a0%bc%ef%bc%8c%e5%ba%95%e8%89%b2%e3%80%81\/#article","isPartOf":{"@id":"http:\/\/www.wunen.com\/index.php\/2025\/05\/20\/python%e5%8a%9e%e5%85%ac-openpyxl%e5%a2%9e%e5%8a%a0%e3%80%81%e5%88%a0%e9%99%a4%e8%a1%8c%e5%88%97%ef%bc%8c%e4%bf%ae%e6%94%b9%e5%8d%95%e5%85%83%e6%a0%bc%ef%bc%8c%e5%ba%95%e8%89%b2%e3%80%81\/"},"author":{"name":"admin@wunen","@id":"http:\/\/www.wunen.com\/#\/schema\/person\/d5f7a6cf545656a9c90d507e64452db8"},"headline":"Python\u529e\u516c\u2014openpyxl(\u589e\u52a0\u3001\u5220\u9664\u884c\u5217\uff0c\u4fee\u6539\u5355\u5143\u683c\uff0c\u5e95\u8272\u3001\u5b57\u4f53\u6837\u5f0f\u8bbe\u7f6e\uff0c\u8bfb\u53d6sheet\u8868)","datePublished":"2025-05-19T16:00:11+00:00","mainEntityOfPage":{"@id":"http:\/\/www.wunen.com\/index.php\/2025\/05\/20\/python%e5%8a%9e%e5%85%ac-openpyxl%e5%a2%9e%e5%8a%a0%e3%80%81%e5%88%a0%e9%99%a4%e8%a1%8c%e5%88%97%ef%bc%8c%e4%bf%ae%e6%94%b9%e5%8d%95%e5%85%83%e6%a0%bc%ef%bc%8c%e5%ba%95%e8%89%b2%e3%80%81\/"},"wordCount":177,"commentCount":0,"publisher":{"@id":"http:\/\/www.wunen.com\/#organization"},"image":{"@id":"http:\/\/www.wunen.com\/index.php\/2025\/05\/20\/python%e5%8a%9e%e5%85%ac-openpyxl%e5%a2%9e%e5%8a%a0%e3%80%81%e5%88%a0%e9%99%a4%e8%a1%8c%e5%88%97%ef%bc%8c%e4%bf%ae%e6%94%b9%e5%8d%95%e5%85%83%e6%a0%bc%ef%bc%8c%e5%ba%95%e8%89%b2%e3%80%81\/#primaryimage"},"thumbnailUrl":"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg","articleSection":["\u5b66\u4e60\u529e\u516c"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/www.wunen.com\/index.php\/2025\/05\/20\/python%e5%8a%9e%e5%85%ac-openpyxl%e5%a2%9e%e5%8a%a0%e3%80%81%e5%88%a0%e9%99%a4%e8%a1%8c%e5%88%97%ef%bc%8c%e4%bf%ae%e6%94%b9%e5%8d%95%e5%85%83%e6%a0%bc%ef%bc%8c%e5%ba%95%e8%89%b2%e3%80%81\/#respond"]}]},{"@type":"WebPage","@id":"http:\/\/www.wunen.com\/index.php\/2025\/05\/20\/python%e5%8a%9e%e5%85%ac-openpyxl%e5%a2%9e%e5%8a%a0%e3%80%81%e5%88%a0%e9%99%a4%e8%a1%8c%e5%88%97%ef%bc%8c%e4%bf%ae%e6%94%b9%e5%8d%95%e5%85%83%e6%a0%bc%ef%bc%8c%e5%ba%95%e8%89%b2%e3%80%81\/","url":"http:\/\/www.wunen.com\/index.php\/2025\/05\/20\/python%e5%8a%9e%e5%85%ac-openpyxl%e5%a2%9e%e5%8a%a0%e3%80%81%e5%88%a0%e9%99%a4%e8%a1%8c%e5%88%97%ef%bc%8c%e4%bf%ae%e6%94%b9%e5%8d%95%e5%85%83%e6%a0%bc%ef%bc%8c%e5%ba%95%e8%89%b2%e3%80%81\/","name":"Python\u529e\u516c\u2014openpyxl(\u589e\u52a0\u3001\u5220\u9664\u884c\u5217\uff0c\u4fee\u6539\u5355\u5143\u683c\uff0c\u5e95\u8272\u3001\u5b57\u4f53\u6837\u5f0f\u8bbe\u7f6e\uff0c\u8bfb\u53d6sheet\u8868) - \u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51","isPartOf":{"@id":"http:\/\/www.wunen.com\/#website"},"primaryImageOfPage":{"@id":"http:\/\/www.wunen.com\/index.php\/2025\/05\/20\/python%e5%8a%9e%e5%85%ac-openpyxl%e5%a2%9e%e5%8a%a0%e3%80%81%e5%88%a0%e9%99%a4%e8%a1%8c%e5%88%97%ef%bc%8c%e4%bf%ae%e6%94%b9%e5%8d%95%e5%85%83%e6%a0%bc%ef%bc%8c%e5%ba%95%e8%89%b2%e3%80%81\/#primaryimage"},"image":{"@id":"http:\/\/www.wunen.com\/index.php\/2025\/05\/20\/python%e5%8a%9e%e5%85%ac-openpyxl%e5%a2%9e%e5%8a%a0%e3%80%81%e5%88%a0%e9%99%a4%e8%a1%8c%e5%88%97%ef%bc%8c%e4%bf%ae%e6%94%b9%e5%8d%95%e5%85%83%e6%a0%bc%ef%bc%8c%e5%ba%95%e8%89%b2%e3%80%81\/#primaryimage"},"thumbnailUrl":"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg","datePublished":"2025-05-19T16:00:11+00:00","breadcrumb":{"@id":"http:\/\/www.wunen.com\/index.php\/2025\/05\/20\/python%e5%8a%9e%e5%85%ac-openpyxl%e5%a2%9e%e5%8a%a0%e3%80%81%e5%88%a0%e9%99%a4%e8%a1%8c%e5%88%97%ef%bc%8c%e4%bf%ae%e6%94%b9%e5%8d%95%e5%85%83%e6%a0%bc%ef%bc%8c%e5%ba%95%e8%89%b2%e3%80%81\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["http:\/\/www.wunen.com\/index.php\/2025\/05\/20\/python%e5%8a%9e%e5%85%ac-openpyxl%e5%a2%9e%e5%8a%a0%e3%80%81%e5%88%a0%e9%99%a4%e8%a1%8c%e5%88%97%ef%bc%8c%e4%bf%ae%e6%94%b9%e5%8d%95%e5%85%83%e6%a0%bc%ef%bc%8c%e5%ba%95%e8%89%b2%e3%80%81\/"]}]},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"http:\/\/www.wunen.com\/index.php\/2025\/05\/20\/python%e5%8a%9e%e5%85%ac-openpyxl%e5%a2%9e%e5%8a%a0%e3%80%81%e5%88%a0%e9%99%a4%e8%a1%8c%e5%88%97%ef%bc%8c%e4%bf%ae%e6%94%b9%e5%8d%95%e5%85%83%e6%a0%bc%ef%bc%8c%e5%ba%95%e8%89%b2%e3%80%81\/#primaryimage","url":"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg","contentUrl":"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/\u8d44\u8baf.jpg","width":260,"height":180},{"@type":"BreadcrumbList","@id":"http:\/\/www.wunen.com\/index.php\/2025\/05\/20\/python%e5%8a%9e%e5%85%ac-openpyxl%e5%a2%9e%e5%8a%a0%e3%80%81%e5%88%a0%e9%99%a4%e8%a1%8c%e5%88%97%ef%bc%8c%e4%bf%ae%e6%94%b9%e5%8d%95%e5%85%83%e6%a0%bc%ef%bc%8c%e5%ba%95%e8%89%b2%e3%80%81\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"http:\/\/www.wunen.com\/"},{"@type":"ListItem","position":2,"name":"Python\u529e\u516c\u2014openpyxl(\u589e\u52a0\u3001\u5220\u9664\u884c\u5217\uff0c\u4fee\u6539\u5355\u5143\u683c\uff0c\u5e95\u8272\u3001\u5b57\u4f53\u6837\u5f0f\u8bbe\u7f6e\uff0c\u8bfb\u53d6sheet\u8868)"}]},{"@type":"WebSite","@id":"http:\/\/www.wunen.com\/#website","url":"http:\/\/www.wunen.com\/","name":"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51","description":"\u8f6f\u4ef6\u8d44\u8baf\u6765\u7269\u5ae9","publisher":{"@id":"http:\/\/www.wunen.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/www.wunen.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-Hans"},{"@type":"Organization","@id":"http:\/\/www.wunen.com\/#organization","name":"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51","url":"http:\/\/www.wunen.com\/","logo":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"http:\/\/www.wunen.com\/#\/schema\/logo\/image\/","url":"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/cropped-\u7269\u5ae9-1.png","contentUrl":"http:\/\/www.wunen.com\/wp-content\/uploads\/2025\/03\/cropped-\u7269\u5ae9-1.png","width":1024,"height":1024,"caption":"\u7269\u5ae9\u8f6f\u4ef6\u8d44\u8baf\u7f51"},"image":{"@id":"http:\/\/www.wunen.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"http:\/\/www.wunen.com\/#\/schema\/person\/d5f7a6cf545656a9c90d507e64452db8","name":"admin@wunen","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"http:\/\/www.wunen.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d90ec1e3faf77c4d4e66e40c29b85ff6401161e0502f401dae2f0e25b38ce25e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d90ec1e3faf77c4d4e66e40c29b85ff6401161e0502f401dae2f0e25b38ce25e?s=96&d=mm&r=g","caption":"admin@wunen"},"sameAs":["http:\/\/www.wunen.com"],"url":"http:\/\/www.wunen.com\/index.php\/author\/adminwunen\/"}]}},"_links":{"self":[{"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/posts\/2476","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/comments?post=2476"}],"version-history":[{"count":0,"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/posts\/2476\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/media\/215"}],"wp:attachment":[{"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/media?parent=2476"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/categories?post=2476"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.wunen.com\/index.php\/wp-json\/wp\/v2\/tags?post=2476"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}