{"id":17099,"date":"2026-04-03T12:53:10","date_gmt":"2026-04-03T04:53:10","guid":{"rendered":"https:\/\/www.aiersheng.cc\/?p=17099"},"modified":"2026-04-03T12:56:12","modified_gmt":"2026-04-03T04:56:12","slug":"17099","status":"publish","type":"post","link":"https:\/\/www.aiersheng.cc\/?p=17099","title":{"rendered":"Python \u8f6f\u4ef6\u5b89\u88c5\uff08\u6700\u8be6\u7ec6\u7248\uff09"},"content":{"rendered":"<h1>\u4e00\u3001\u5b89\u88c5 Python\uff08\u8be6\u7ec6\u6b65\u9aa4\uff09<\/h1>\n<h2>1. \u4e0b\u8f7d Python<\/h2>\n<ol>\n<li>\u6253\u5f00\u6d4f\u89c8\u5668\uff0c\u8fdb\u5165\u5b98\u7f51\uff1a<a href=\"https:\/\/www.python.org\/downloads\/\" target=\"_blank\" rel=\"noopener\">https:\/\/www.python.org\/downloads\/<\/a><\/li>\n<li>\u70b9\u51fb <strong>Download Python 3.10 \u53ca\u4ee5\u4e0a\u7248\u672c<\/strong><\/li>\n<\/ol>\n<h2>2. \u5b89\u88c5 Python\uff08\u5173\u952e\uff01\uff09<\/h2>\n<ol>\n<li>\u8fd0\u884c\u5b89\u88c5\u5305<\/li>\n<li><strong>\u6700\u5e95\u90e8\u4e00\u5b9a\u8981\u52fe\u9009\uff1aAdd Python.exe to PATH<\/strong><\/li>\n<li>\u70b9\u51fb <strong>Install Now<\/strong><\/li>\n<li>\u7b49\u5f85\u5b89\u88c5\u5b8c\u6210 \u2192 Close<\/li>\n<\/ol>\n<h2>3. \u9a8c\u8bc1\u5b89\u88c5<\/h2>\n<ol>\n<li>\u6309 <code>Win + R<\/code> \u2192 \u8f93\u5165 <code>cmd<\/code> \u6253\u5f00\u547d\u4ee4\u884c<\/li>\n<li>\u8f93\u5165\uff1a<\/li>\n<\/ol>\n<div>\u00a0<\/div>\n<div>\n<div dir=\"ltr\">\n<div>\n<div>\n<div tabindex=\"0\" aria-describedby=\"05c82n4\">\n<div>bash<\/div>\n<div>\u00a0<\/div>\n<\/div>\n<div>\n<div>\u8fd0\u884c<\/div>\n<div tabindex=\"0\" aria-describedby=\"ajgv3pt\">\u00a0<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div>\n<pre><code>python --version\r\n<\/code><\/pre>\n<\/div>\n<div>\n<div>\u00a0<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div>\u51fa\u73b0\u7248\u672c\u53f7\uff08\u5982 Python 3.10.0\uff09\u5373\u6210\u529f\u3002<\/div>\n<h2>4. \u5b89\u88c5\u7ed8\u56fe\u9700\u8981\u7684\u5e93<\/h2>\n<div>\u5728 cmd \u91cc\u8f93\u5165\uff1a<\/div>\n<div>\u00a0<\/div>\n<div>\n<div dir=\"ltr\">\n<div>\n<div>\n<div tabindex=\"0\" aria-describedby=\"66z9f0a\">\n<div>bash<\/div>\n<div>\u00a0<\/div>\n<\/div>\n<div>\n<div>\u8fd0\u884c<\/div>\n<div tabindex=\"0\" aria-describedby=\"vjr3wcd\">\u00a0<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div>\n<pre><code>pip install pandas matplotlib\r\n<\/code><\/pre>\n<\/div>\n<div>\n<div>\u51fa\u73b0 <code>Successfully<\/code> \u8868\u793a\u5b89\u88c5\u6210\u529f\u3002<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div>\u00a0<\/div>\n<hr \/>\n<h1>\u4e8c\u3001\u5b89\u88c5 VS Code \u5e76\u914d\u7f6e Python \u73af\u5883<\/h1>\n<h2>1. \u4e0b\u8f7d VS Code<\/h2>\n<div>\u00a0<\/div>\n<div>\u5b98\u7f51\uff1a<a href=\"https:\/\/code.visualstudio.com\/\" target=\"_blank\" rel=\"noopener\">https:\/\/code.visualstudio.com\/<\/a><\/p>\n<div>\u00a0<\/div>\n<p>\u70b9\u51fb Download \u4e0b\u8f7d\u5b89\u88c5\u5305\uff0c\u4e00\u8def\u4e0b\u4e00\u6b65\u5b89\u88c5\u5373\u53ef\u3002<\/p><\/div>\n<h2>2. \u5b89\u88c5 Python \u63d2\u4ef6<\/h2>\n<ol>\n<li>\u6253\u5f00 VS Code<\/li>\n<li>\u70b9\u51fb\u5de6\u4fa7 <strong>\u6269\u5c55\uff08Extensions\uff09<\/strong><\/li>\n<li>\u641c\u7d22\uff1a<strong>Python<\/strong><\/li>\n<li>\u5b89\u88c5\u5fae\u8f6f\u5b98\u65b9\u7684 Python \u63d2\u4ef6<\/li>\n<\/ol>\n<div>\u00a0<\/div>\n<h2>3. \u9009\u62e9 Python \u89e3\u91ca\u5668<\/h2>\n<div>\u00a0<\/div>\n<ol>\n<li>\u6309 <code>Ctrl + Shift + P<\/code><\/li>\n<li>\u8f93\u5165\uff1a<strong>Python: Select Interpreter<\/strong><\/li>\n<li>\u9009\u62e9\u4f60\u521a\u5b89\u88c5\u7684 Python \u7248\u672c<\/li>\n<\/ol>\n<hr \/>\n<h1>\u4e8c\u3001\u51c6\u5907\u6570\u636e\u6587\u4ef6\uff08\u8001\u5e08\u8003\u6838\uff1a\u6570\u636e\u6765\u6e90\uff09<\/h1>\n<h2>1. \u65b0\u5efa Excel \u6587\u4ef6<\/h2>\n<div>\u5728\u684c\u9762\u65b0\u5efa\u4e00\u4e2a Excel\uff0c\u547d\u540d\u4e3a\uff1a<code>data.xlsx<\/code><\/div>\n<div>\u00a0<\/div>\n<div>\u5185\u5bb9\u5982\u4e0b\uff08\u76f4\u63a5\u7167\u6284\uff09\uff1a<\/div>\n<div>\u00a0<\/div>\n<div>\n<div>\n<div>\u8868\u683c<\/div>\n<div>\n<div tabindex=\"0\" aria-describedby=\"jldme7l\">\u00a0<\/div>\n<div tabindex=\"0\" aria-describedby=\"fbcz0b8\">\u00a0<\/div>\n<\/div>\n<\/div>\n<div>\n<div>\n<div>\n<table>\n<thead>\n<tr>\n<th>\u65f6\u95f4<\/th>\n<th>\u6570\u503c<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>1<\/td>\n<td>10<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>15<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>13<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>20<\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td>18<\/td>\n<\/tr>\n<tr>\n<td>6<\/td>\n<td>25<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div>\u00a0<\/div>\n<div>\u4fdd\u5b58\u5230\u684c\u9762\u3002<\/div>\n<div>\u00a0<\/div>\n<hr \/>\n<h1>\u56db\u3001\u5728 VS Code \u4e2d\u5199\u4ee3\u7801\uff08\u9010\u884c\u8be6\u7ec6\u89e3\u91ca\uff09<\/h1>\n<div>\u00a0<\/div>\n<h2>1. \u65b0\u5efa\u6587\u4ef6<\/h2>\n<div>\u00a0<\/div>\n<ol>\n<li>\u6253\u5f00 VS Code<\/li>\n<li>\u6587\u4ef6 \u2192 \u65b0\u5efa\u6587\u4ef6<\/li>\n<li>\u4fdd\u5b58\u5230\u684c\u9762\uff0c\u547d\u540d\u4e3a\uff1a<code>main.py<\/code><\/li>\n<\/ol>\n<div>\u00a0<\/div>\n<h2>2. \u5b8c\u6574\u4ee3\u7801\uff08\u5e26\u8be6\u7ec6\u6ce8\u91ca\uff09<\/h2>\n<div>\u00a0<\/div>\n<div>\n<div dir=\"ltr\">\n<div>\n<div>\n<div tabindex=\"0\" aria-describedby=\"7b0jhcy\">\n<div>python<\/div>\n<div>\u00a0<\/div>\n<\/div>\n<div>\n<div>\u8fd0\u884c<\/div>\n<div tabindex=\"0\" aria-describedby=\"v916qc8\">\u00a0<\/div>\n<div tabindex=\"0\" aria-describedby=\"2a1ng6j\">\u00a0<\/div>\n<div tabindex=\"0\" aria-describedby=\"lld0klr\">\u00a0<\/div>\n<div tabindex=\"0\" aria-describedby=\"gid3iiq\">\u00a0<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div>\n<pre><code># 1. \u5bfc\u5165\u9700\u8981\u7684\u5e93\uff08\u8003\u6838\u91cd\u70b9\uff1a\u5e93\u7684\u5bfc\u5165\uff09\r\nimport pandas as pd\r\nimport matplotlib.pyplot as plt\r\n\r\n# 2. \u89e3\u51b3\u4e2d\u6587\u4e71\u7801\uff08\u5fc5\u987b\u5199\uff0c\u8001\u5e08\u5fc5\u67e5\uff09\r\nplt.rcParams['font.sans-serif'] = ['SimHei']  # \u7528\u9ed1\u4f53\u663e\u793a\u4e2d\u6587\r\nplt.rcParams['axes.unicode_minus'] = False    # \u6b63\u5e38\u663e\u793a\u8d1f\u53f7\r\n\r\n# 3. \u5bfc\u5165Excel\u6570\u636e\uff08\u8003\u6838\u6838\u5fc3\uff1a\u6570\u636e\u5bfc\u5165\uff09\r\n# \u6587\u4ef6\u5728\u684c\u9762\uff0c\u76f4\u63a5\u5199\u6587\u4ef6\u540d\r\ndf = pd.read_excel('data.xlsx')\r\n\r\n# 4. \u67e5\u770b\u6570\u636e\u662f\u5426\u6210\u529f\u5bfc\u5165\r\nprint(\"\u5bfc\u5165\u7684\u6570\u636e\u5185\u5bb9\uff1a\")\r\nprint(df)\r\n\r\n# 5. \u7ed8\u5236\u6298\u7ebf\u56fe\uff08\u8003\u6838\u91cd\u70b9\uff1a\u6298\u7ebf\u56fe\u7ed8\u5236\uff09\r\nplt.plot(\r\n    df['\u6708\u4efd'],        # X\u8f74\u6570\u636e\uff1a\u6708\u4efd\r\n    df['\u9500\u552e\u989d'],      # Y\u8f74\u6570\u636e\uff1a\u9500\u552e\u989d\r\n    color='blue',      # \u7ebf\u6761\u989c\u8272\r\n    marker='o',        # \u6570\u636e\u70b9\u6807\u8bb0\u4e3a\u5706\u5708\r\n    linestyle='-',     # \u5b9e\u7ebf\r\n    linewidth=2,       # \u7ebf\u6761\u5bbd\u5ea6\r\n    label='\u6708\u5ea6\u9500\u552e\u989d' # \u56fe\u4f8b\u6807\u7b7e\r\n)\r\n\r\n# 6. \u56fe\u8868\u7f8e\u5316\uff08\u89c4\u8303\u5206\uff0c\u5fc5\u987b\u6709\uff09\r\nplt.title('2025\u5e74\u4e0a\u534a\u5e74\u9500\u552e\u989d\u8d8b\u52bf', fontsize=14)  # \u56fe\u8868\u6807\u9898\r\nplt.xlabel('\u6708\u4efd', fontsize=12)                    # X\u8f74\u6807\u9898\r\nplt.ylabel('\u9500\u552e\u989d\uff08\u4e07\u5143\uff09', fontsize=12)          # Y\u8f74\u6807\u9898\r\n\r\n# 7. \u663e\u793a\u56fe\u4f8b\u548c\u7f51\u683c\u7ebf\r\nplt.legend()        # \u663e\u793a\u56fe\u4f8b\r\nplt.grid(True, linestyle='--', alpha=0.3)  # \u7f51\u683c\u7ebf\r\n\r\n# 8. \u663e\u793a\u56fe\u8868\r\nplt.show()\r\n<\/code><\/pre>\n<\/div>\n<div>\n<div>\u00a0<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div>\u00a0<\/div>\n<hr \/>\n<div>\u00a0<\/div>\n<h1>\u4e94\u3001\u5728 VS Code \u4e2d\u8fd0\u884c\u4ee3\u7801<\/h1>\n<div>\u00a0<\/div>\n<ol>\n<li>\u786e\u4fdd <code>data.xlsx<\/code> \u548c <code>main.py<\/code> \u90fd\u5728<strong>\u684c\u9762<\/strong><\/li>\n<li>\u5728 VS Code \u53f3\u4e0a\u89d2\u70b9\u51fb \u25b6 \u8fd0\u884c\u6309\u94ae\n<div>\u00a0<\/div>\n<p>\u6216\u8005\u53f3\u952e \u2192 <strong>\u5728\u7ec8\u7aef\u4e2d\u8fd0\u884c Python \u6587\u4ef6<\/strong><\/li>\n<li>\u63a7\u5236\u53f0\u4f1a\u8f93\u51fa\u6570\u636e<\/li>\n<li>\u81ea\u52a8\u5f39\u51fa<strong>\u6298\u7ebf\u56fe\u7a97\u53e3<\/strong><\/li>\n<\/ol>\n<div>\u00a0<\/div>\n<hr \/>\n<div>\u00a0<\/div>\n<h1>\u516d\u3001\u4f5c\u4e1a\u8003\u6838\u91cd\u70b9\uff08\u8001\u5e08\u5fc5\u770b\uff09<\/h1>\n<div>\u00a0<\/div>\n<ol>\n<li>Python \u5b89\u88c5\u6210\u529f\uff0c\u73af\u5883\u53d8\u91cf\u914d\u7f6e\u6b63\u786e<\/li>\n<li>pandas\u3001matplotlib \u5e93\u5b89\u88c5\u6210\u529f<\/li>\n<li>VS Code \u5b89\u88c5\u5e76\u914d\u7f6e Python \u73af\u5883<\/li>\n<li>\u80fd\u6210\u529f\u5bfc\u5165 Excel \u6570\u636e\u5e76\u6253\u5370<\/li>\n<li>\u4f7f\u7528 <code>plt.plot()<\/code> \u7ed8\u5236\u6298\u7ebf\u56fe<\/li>\n<li>\u56fe\u8868\u5305\u542b\uff1a\u6807\u9898\u3001\u5750\u6807\u8f74\u3001\u56fe\u4f8b\u3001\u7f51\u683c<\/li>\n<li>\u4e2d\u6587\u6b63\u5e38\u663e\u793a\uff0c\u65e0\u4e71\u7801<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u5b89\u88c5 Python\uff08\u8be6\u7ec6\u6b65\u9aa4\uff09 1&#8230;.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[68],"tags":[],"class_list":["post-17099","post","type-post","status-publish","format-standard","hentry","category-zzjy"],"_links":{"self":[{"href":"https:\/\/www.aiersheng.cc\/index.php?rest_route=\/wp\/v2\/posts\/17099","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.aiersheng.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.aiersheng.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.aiersheng.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.aiersheng.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=17099"}],"version-history":[{"count":0,"href":"https:\/\/www.aiersheng.cc\/index.php?rest_route=\/wp\/v2\/posts\/17099\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.aiersheng.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=17099"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.aiersheng.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=17099"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.aiersheng.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=17099"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}