{"id":1162374,"date":"2025-01-13T19:27:47","date_gmt":"2025-01-13T11:27:47","guid":{"rendered":""},"modified":"2025-01-13T19:27:50","modified_gmt":"2025-01-13T11:27:50","slug":"%e5%a6%82%e4%bd%95%e6%89%93%e5%bc%80python%e7%9a%84%e4%ba%a4%e4%ba%92%e6%a8%a1%e5%bc%8f","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1162374.html","title":{"rendered":"\u5982\u4f55\u6253\u5f00python\u7684\u4ea4\u4e92\u6a21\u5f0f"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25203422\/99d03611-58f1-4ceb-ac0e-dff946d56725.webp\" alt=\"\u5982\u4f55\u6253\u5f00python\u7684\u4ea4\u4e92\u6a21\u5f0f\" \/><\/p>\n<p><p> <strong>\u6253\u5f00Python\u4ea4\u4e92\u6a21\u5f0f\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\uff0c\u6700\u5e38\u89c1\u7684\u6709\u4ee5\u4e0b\u51e0\u79cd\uff1a\u76f4\u63a5\u5728\u547d\u4ee4\u884c\u8f93\u5165<code>python<\/code>\u3001\u901a\u8fc7\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u5982PyCharm\u3001\u4f7f\u7528Jupyter Notebook\u3002<\/strong> \u5176\u4e2d\uff0c\u6700\u7b80\u5355\u548c\u76f4\u63a5\u7684\u65b9\u5f0f\u662f\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165<code>python<\/code>\u6216<code>python3<\/code>\uff0c\u8fd9\u5c06\u542f\u52a8Python\u89e3\u91ca\u5668\u5e76\u8fdb\u5165\u4ea4\u4e92\u6a21\u5f0f\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u63cf\u8ff0\u5982\u4f55\u901a\u8fc7\u547d\u4ee4\u884c\u542f\u52a8Python\u4ea4\u4e92\u6a21\u5f0f\u3002<\/p>\n<\/p>\n<p><p>\u5728Windows\u64cd\u4f5c\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\uff08Command Prompt\uff09\u6216\u8005PowerShell\uff0c\u7136\u540e\u8f93\u5165\u547d\u4ee4<code>python<\/code>\u6216<code>python3<\/code>\u5e76\u6309\u4e0b\u56de\u8f66\u952e\u3002\u5982\u679cPython\u5df2\u7ecf\u6b63\u786e\u5b89\u88c5\u5e76\u914d\u7f6e\u4e86\u7cfb\u7edf\u8def\u5f84\uff08PATH\uff09\uff0c\u4f60\u4f1a\u770b\u5230Python\u7684\u7248\u672c\u4fe1\u606f\u548c\u63d0\u793a\u7b26<code>&gt;&gt;&gt;<\/code>\uff0c\u8868\u793a\u5df2\u7ecf\u8fdb\u5165\u4e86Python\u4ea4\u4e92\u6a21\u5f0f\u3002\u5728MacOS\u548cLinux\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u6253\u5f00\u7ec8\u7aef\uff08Terminal\uff09\u5e76\u8f93\u5165\u540c\u6837\u7684\u547d\u4ee4<code>python<\/code>\u6216<code>python3<\/code>\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u547d\u4ee4\u884c\u65b9\u5f0f\u6253\u5f00Python\u4ea4\u4e92\u6a21\u5f0f<\/h3>\n<\/p>\n<p><p>\u901a\u8fc7\u547d\u4ee4\u884c\u542f\u52a8Python\u4ea4\u4e92\u6a21\u5f0f\u662f\u6700\u76f4\u63a5\u7684\u65b9\u6cd5\uff0c\u4e0d\u9700\u8981\u989d\u5916\u7684\u5b89\u88c5\u548c\u8bbe\u7f6e\u3002\u4ee5\u4e0b\u662f\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<p><h4>1. Windows\u7cfb\u7edf<\/h4>\n<\/p>\n<ol>\n<li>\n<p>\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\uff08Command Prompt\uff09\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u6309\u4e0b\u952e\u76d8\u4e0a\u7684<code>Win + R<\/code>\u7ec4\u5408\u952e\uff0c\u8f93\u5165<code>cmd<\/code>\uff0c\u7136\u540e\u6309\u4e0b\u56de\u8f66\u952e\u3002<\/li>\n<li>\u6216\u8005\u5728\u5f00\u59cb\u83dc\u5355\u4e2d\u641c\u7d22<code>cmd<\/code>\uff0c\u70b9\u51fb\u547d\u4ee4\u63d0\u793a\u7b26\u56fe\u6807\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u8f93\u5165<code>python<\/code>\u6216<code>python3<\/code>\uff0c\u7136\u540e\u6309\u4e0b\u56de\u8f66\u952e\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">python<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p>\u5982\u679cPython\u5df2\u7ecf\u6b63\u786e\u5b89\u88c5\u5e76\u914d\u7f6e\u4e86\u7cfb\u7edf\u8def\u5f84\uff08PATH\uff09\uff0c\u4f60\u4f1a\u770b\u5230\u7c7b\u4f3c\u5982\u4e0b\u7684\u4fe1\u606f\uff1a<\/p>\n<\/p>\n<p><pre><code>Python 3.x.x (default, Month Day, Year, Time) <\/p>\n<p>[GCC x.x.x] on linux<\/p>\n<p>Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.<\/p>\n<p>&gt;&gt;&gt;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u8868\u793a\u4f60\u5df2\u7ecf\u8fdb\u5165\u4e86Python\u4ea4\u4e92\u6a21\u5f0f\uff0c\u53ef\u4ee5\u76f4\u63a5\u8f93\u5165Python\u4ee3\u7801\u8fdb\u884c\u4ea4\u4e92\u5f0f\u7f16\u7a0b\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h4>2. MacOS\u548cLinux\u7cfb\u7edf<\/h4>\n<\/p>\n<ol>\n<li>\n<p>\u6253\u5f00\u7ec8\u7aef\uff08Terminal\uff09\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u5728MacOS\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u5feb\u6377\u952e<code>Command + Space<\/code>\u8c03\u51faSpotlight\u641c\u7d22\uff0c\u8f93\u5165<code>Terminal<\/code>\u5e76\u6309\u4e0b\u56de\u8f66\u952e\u3002<\/li>\n<li>\u5728Linux\u4e2d\uff0c\u53ef\u4ee5\u6309\u4e0b\u5feb\u6377\u952e<code>Ctrl + Alt + T<\/code>\u6253\u5f00\u7ec8\u7aef\uff0c\u6216\u8005\u5728\u5e94\u7528\u7a0b\u5e8f\u83dc\u5355\u4e2d\u627e\u5230\u7ec8\u7aef\u56fe\u6807\u5e76\u70b9\u51fb\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u8f93\u5165<code>python<\/code>\u6216<code>python3<\/code>\uff0c\u7136\u540e\u6309\u4e0b\u56de\u8f66\u952e\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">python3<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p>\u5982\u679cPython\u5df2\u7ecf\u6b63\u786e\u5b89\u88c5\u5e76\u914d\u7f6e\u4e86\u7cfb\u7edf\u8def\u5f84\uff08PATH\uff09\uff0c\u4f60\u4f1a\u770b\u5230\u7c7b\u4f3c\u5982\u4e0b\u7684\u4fe1\u606f\uff1a<\/p>\n<\/p>\n<p><pre><code>Python 3.x.x (default, Month Day, Year, Time) <\/p>\n<p>[GCC x.x.x] on linux<\/p>\n<p>Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.<\/p>\n<p>&gt;&gt;&gt;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8868\u793a\u5df2\u7ecf\u8fdb\u5165\u4e86Python\u4ea4\u4e92\u6a21\u5f0f\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h3>\u4e8c\u3001\u901a\u8fc7\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u6253\u5f00Python\u4ea4\u4e92\u6a21\u5f0f<\/h3>\n<\/p>\n<p><p>\u4f7f\u7528\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u5982PyCharm\u3001Visual Studio Code\u3001Spyder\u7b49\u4e5f\u53ef\u4ee5\u65b9\u4fbf\u5730\u6253\u5f00Python\u4ea4\u4e92\u6a21\u5f0f\u3002\u8fd9\u4e9bIDE\u901a\u5e38\u63d0\u4f9b\u4e86\u96c6\u6210\u7684\u7ec8\u7aef\u6216\u63a7\u5236\u53f0\uff0c\u53ef\u4ee5\u76f4\u63a5\u5728\u5176\u4e2d\u8fd0\u884cPython\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><h4>1. PyCharm<\/h4>\n<\/p>\n<ol>\n<li>\n<p>\u4e0b\u8f7d\u5e76\u5b89\u88c5PyCharm\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u8bbf\u95eeJetBr<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>ns\u5b98\u65b9\u7f51\u7ad9\uff0c\u4e0b\u8f7d\u9002\u7528\u4e8e\u4f60\u64cd\u4f5c\u7cfb\u7edf\u7684PyCharm\u5b89\u88c5\u5305\u5e76\u8fdb\u884c\u5b89\u88c5\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u6253\u5f00PyCharm\u5e76\u521b\u5efa\u4e00\u4e2a\u65b0\u9879\u76ee\u6216\u6253\u5f00\u5df2\u6709\u9879\u76ee\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p>\u6253\u5f00Python\u63a7\u5236\u53f0\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u5728PyCharm\u7684\u5e95\u90e8\u7a97\u53e3\u4e2d\uff0c\u70b9\u51fb<code>Python Console<\/code>\u6807\u7b7e\u3002<\/li>\n<li>\u4f60\u4f1a\u770b\u5230\u4e00\u4e2a\u65b0\u7684\u63a7\u5236\u53f0\u7a97\u53e3\uff0c\u7c7b\u4f3c\u4e8e\u547d\u4ee4\u884c\u4ea4\u4e92\u6a21\u5f0f\uff0c\u53ef\u4ee5\u76f4\u63a5\u8f93\u5165Python\u4ee3\u7801\u8fdb\u884c\u4ea4\u4e92\u5f0f\u7f16\u7a0b\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h4>2. Visual Studio Code<\/h4>\n<\/p>\n<ol>\n<li>\n<p>\u4e0b\u8f7d\u5e76\u5b89\u88c5Visual Studio Code\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u8bbf\u95eeVisual Studio Code\u5b98\u65b9\u7f51\u7ad9\uff0c\u4e0b\u8f7d\u9002\u7528\u4e8e\u4f60\u64cd\u4f5c\u7cfb\u7edf\u7684\u5b89\u88c5\u5305\u5e76\u8fdb\u884c\u5b89\u88c5\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u5b89\u88c5Python\u6269\u5c55\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u6253\u5f00Visual Studio Code\uff0c\u70b9\u51fb\u5de6\u4fa7\u7684\u6269\u5c55\u56fe\u6807\uff0c\u641c\u7d22<code>Python<\/code>\u5e76\u5b89\u88c5\u7531Microsoft\u5f00\u53d1\u7684Python\u6269\u5c55\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u6253\u5f00\u7ec8\u7aef\u5e76\u542f\u52a8Python\u4ea4\u4e92\u6a21\u5f0f\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u5728Visual Studio Code\u4e2d\uff0c\u70b9\u51fb\u9876\u90e8\u83dc\u5355\u680f\u7684<code>Terminal<\/code>\uff0c\u9009\u62e9<code>New Terminal<\/code>\u3002<\/li>\n<li>\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165<code>python<\/code>\u6216<code>python3<\/code>\uff0c\u6309\u4e0b\u56de\u8f66\u952e\u5373\u53ef\u8fdb\u5165Python\u4ea4\u4e92\u6a21\u5f0f\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h3>\u4e09\u3001\u4f7f\u7528Jupyter Notebook<\/h3>\n<\/p>\n<p><p>Jupyter Notebook\u662f\u4e00\u79cd\u975e\u5e38\u6d41\u884c\u7684\u4ea4\u4e92\u5f0f\u8ba1\u7b97\u73af\u5883\uff0c\u7279\u522b\u9002\u7528\u4e8e\u6570\u636e\u5206\u6790\u3001\u79d1\u5b66\u8ba1\u7b97\u548c\u6559\u5b66\u3002\u4f7f\u7528Jupyter Notebook\u53ef\u4ee5\u65b9\u4fbf\u5730\u7f16\u5199\u548c\u6267\u884cPython\u4ee3\u7801\uff0c\u5e76\u4e14\u53ef\u4ee5\u5c06\u4ee3\u7801\u3001\u6587\u672c\u3001\u56fe\u8868\u7b49\u5185\u5bb9\u6574\u5408\u5728\u4e00\u4e2a\u6587\u6863\u4e2d\u3002<\/p>\n<\/p>\n<p><h4>1. \u5b89\u88c5Jupyter Notebook<\/h4>\n<\/p>\n<ol>\n<li>\n<p>\u786e\u4fdd\u5df2\u7ecf\u5b89\u88c5\u4e86Python\u548cpip\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\u6216\u7ec8\u7aef\uff0c\u8f93\u5165<code>python --version<\/code>\u68c0\u67e5Python\u7248\u672c\u3002<\/li>\n<li>\u8f93\u5165<code>pip --version<\/code>\u68c0\u67e5pip\u7248\u672c\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u4f7f\u7528pip\u5b89\u88c5Jupyter Notebook\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">pip install notebook<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><h4>2. \u542f\u52a8Jupyter Notebook<\/h4>\n<\/p>\n<ol>\n<li>\n<p>\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\u6216\u7ec8\u7aef\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8Jupyter Notebook\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">jupyter notebook<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p>\u6d4f\u89c8\u5668\u4f1a\u81ea\u52a8\u6253\u5f00Jupyter Notebook\u7684\u4e3b\u9875\uff0c\u663e\u793a\u6587\u4ef6\u7cfb\u7edf\u7684\u76ee\u5f55\u7ed3\u6784\u3002<\/p>\n<\/p>\n<\/li>\n<li>\n<p>\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Notebook\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u5728\u53f3\u4e0a\u89d2\u70b9\u51fb<code>New<\/code>\u6309\u94ae\uff0c\u9009\u62e9<code>Python 3<\/code>\u3002<\/li>\n<li>\u7cfb\u7edf\u4f1a\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Notebook\u6587\u4ef6\uff0c\u4f60\u53ef\u4ee5\u5728\u5176\u4e2d\u7f16\u5199\u548c\u6267\u884cPython\u4ee3\u7801\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h3>\u56db\u3001Python\u4ea4\u4e92\u6a21\u5f0f\u7684\u57fa\u672c\u7528\u6cd5<\/h3>\n<\/p>\n<p><p>\u8fdb\u5165Python\u4ea4\u4e92\u6a21\u5f0f\u540e\uff0c\u53ef\u4ee5\u76f4\u63a5\u8f93\u5165Python\u4ee3\u7801\u5e76\u6309\u4e0b\u56de\u8f66\u952e\u6267\u884c\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u57fa\u672c\u7528\u6cd5\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><h4>1. \u6570\u5b66\u8fd0\u7b97<\/h4>\n<\/p>\n<p><p>\u5728\u4ea4\u4e92\u6a21\u5f0f\u4e0b\uff0c\u53ef\u4ee5\u76f4\u63a5\u8fdb\u884c\u6570\u5b66\u8fd0\u7b97\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">&gt;&gt;&gt; 2 + 3<\/p>\n<p>5<\/p>\n<p>&gt;&gt;&gt; 10 \/ 2<\/p>\n<p>5.0<\/p>\n<p>&gt;&gt;&gt; 3  2<\/p>\n<p>9<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u53d8\u91cf\u8d4b\u503c<\/h4>\n<\/p>\n<p><p>\u53ef\u4ee5\u5b9a\u4e49\u53d8\u91cf\u5e76\u8fdb\u884c\u8d4b\u503c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">&gt;&gt;&gt; x = 5<\/p>\n<p>&gt;&gt;&gt; y = 10<\/p>\n<p>&gt;&gt;&gt; z = x + y<\/p>\n<p>&gt;&gt;&gt; z<\/p>\n<p>15<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3. \u51fd\u6570\u5b9a\u4e49<\/h4>\n<\/p>\n<p><p>\u53ef\u4ee5\u5b9a\u4e49\u548c\u8c03\u7528\u51fd\u6570\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">&gt;&gt;&gt; def greet(name):<\/p>\n<p>...     return f&quot;Hello, {name}!&quot;<\/p>\n<p>...<\/p>\n<p>&gt;&gt;&gt; greet(&quot;Alice&quot;)<\/p>\n<p>&#39;Hello, Alice!&#39;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>4. \u5bfc\u5165\u6a21\u5757<\/h4>\n<\/p>\n<p><p>\u53ef\u4ee5\u5bfc\u5165Python\u6807\u51c6\u5e93\u548c\u7b2c\u4e09\u65b9\u5e93\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">&gt;&gt;&gt; import math<\/p>\n<p>&gt;&gt;&gt; math.sqrt(16)<\/p>\n<p>4.0<\/p>\n<p>&gt;&gt;&gt; import numpy as np<\/p>\n<p>&gt;&gt;&gt; np.array([1, 2, 3])<\/p>\n<p>array([1, 2, 3])<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u4e94\u3001\u5e38\u89c1\u95ee\u9898\u548c\u89e3\u51b3\u65b9\u6cd5<\/h3>\n<\/p>\n<p><p>\u5728\u4f7f\u7528Python\u4ea4\u4e92\u6a21\u5f0f\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u4e00\u4e9b\u5e38\u89c1\u95ee\u9898\u548c\u9519\u8bef\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u89c1\u95ee\u9898\u53ca\u5176\u89e3\u51b3\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<p><h4>1. Python\u672a\u5b89\u88c5\u6216\u8def\u5f84\u672a\u914d\u7f6e<\/h4>\n<\/p>\n<p><p>\u5982\u679c\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165<code>python<\/code>\u6216<code>python3<\/code>\u540e\u51fa\u73b0<code>&#39;python&#39; \u4e0d\u662f\u5185\u90e8\u6216\u5916\u90e8\u547d\u4ee4<\/code>\u9519\u8bef\uff0c\u53ef\u80fd\u662f\u56e0\u4e3aPython\u672a\u5b89\u88c5\u6216\u7cfb\u7edf\u8def\u5f84\uff08PATH\uff09\u672a\u6b63\u786e\u914d\u7f6e\u3002\u89e3\u51b3\u65b9\u6cd5\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p>\u5b89\u88c5Python\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u8bbf\u95eePython\u5b98\u65b9\u7f51\u7ad9\uff0c\u4e0b\u8f7d\u9002\u7528\u4e8e\u4f60\u64cd\u4f5c\u7cfb\u7edf\u7684\u5b89\u88c5\u5305\u5e76\u8fdb\u884c\u5b89\u88c5\u3002<\/li>\n<li>\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u52fe\u9009<code>Add Python to PATH<\/code>\u9009\u9879\uff0c\u8fd9\u4f1a\u81ea\u52a8\u914d\u7f6e\u7cfb\u7edf\u8def\u5f84\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u624b\u52a8\u914d\u7f6e\u7cfb\u7edf\u8def\u5f84\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u5728Windows\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u624b\u52a8\u914d\u7f6e\u7cfb\u7edf\u8def\u5f84\uff1a\n<ul>\n<li>\u6253\u5f00\u63a7\u5236\u9762\u677f\uff0c\u9009\u62e9<code>\u7cfb\u7edf\u548c\u5b89\u5168<\/code>\uff0c\u7136\u540e\u9009\u62e9<code>\u7cfb\u7edf<\/code>\u3002<\/li>\n<li>\u70b9\u51fb<code>\u9ad8\u7ea7\u7cfb\u7edf\u8bbe\u7f6e<\/code>\uff0c\u5728\u7cfb\u7edf\u5c5e\u6027\u7a97\u53e3\u4e2d\u9009\u62e9<code>\u73af\u5883\u53d8\u91cf<\/code>\u3002<\/li>\n<li>\u5728\u73af\u5883\u53d8\u91cf\u7a97\u53e3\u4e2d\uff0c\u627e\u5230<code>\u7cfb\u7edf\u53d8\u91cf<\/code>\u4e2d\u7684<code>Path<\/code>\uff0c\u9009\u4e2d\u5e76\u70b9\u51fb<code>\u7f16\u8f91<\/code>\u3002<\/li>\n<li>\u5728\u53d8\u91cf\u503c\u4e2d\u6dfb\u52a0Python\u7684\u5b89\u88c5\u8def\u5f84\uff0c\u4f8b\u5982<code>C:\\Python39<\/code>\uff0c\u7136\u540e\u70b9\u51fb<code>\u786e\u5b9a<\/code>\u4fdd\u5b58\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h4>2. Python\u7248\u672c\u51b2\u7a81<\/h4>\n<\/p>\n<p><p>\u5982\u679c\u7cfb\u7edf\u4e2d\u5b89\u88c5\u4e86\u591a\u4e2a\u7248\u672c\u7684Python\uff0c\u53ef\u80fd\u4f1a\u5bfc\u81f4\u7248\u672c\u51b2\u7a81\u3002\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u6cd5\u89e3\u51b3\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p>\u4f7f\u7528\u7279\u5b9a\u7248\u672c\u7684Python\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165\u7279\u5b9a\u7248\u672c\u7684Python\u547d\u4ee4\uff0c\u4f8b\u5982<code>python3.9<\/code>\uff0c\u4ee5\u542f\u52a8\u5bf9\u5e94\u7248\u672c\u7684Python\u89e3\u91ca\u5668\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u4f7f\u7528\u865a\u62df\u73af\u5883\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u521b\u5efa\u4e00\u4e2a\u865a\u62df\u73af\u5883\uff0c\u786e\u4fdd\u5728\u8be5\u73af\u5883\u4e2d\u4f7f\u7528\u7279\u5b9a\u7248\u672c\u7684Python\u548c\u4f9d\u8d56\u5e93\u3002<\/li>\n<\/ul>\n<p><pre><code class=\"language-sh\">python -m venv myenv<\/p>\n<p>source myenv\/bin\/activate  # MacOS\/Linux<\/p>\n<p>myenv\\Scripts\\activate  # Windows<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><h4>3. Jupyter Notebook\u65e0\u6cd5\u542f\u52a8<\/h4>\n<\/p>\n<p><p>\u5982\u679cJupyter Notebook\u65e0\u6cd5\u542f\u52a8\uff0c\u53ef\u80fd\u662f\u7531\u4e8e\u672a\u6b63\u786e\u5b89\u88c5\u6216\u4f9d\u8d56\u5e93\u7f3a\u5931\u3002\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u6cd5\u89e3\u51b3\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p>\u68c0\u67e5Jupyter Notebook\u5b89\u88c5\u662f\u5426\u6210\u529f\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">pip show notebook<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p>\u5347\u7ea7Jupyter Notebook\u548c\u76f8\u5173\u4f9d\u8d56\u5e93\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">pip install --upgrade notebook<\/p>\n<p>pip install --upgrade jupyter<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p>\u68c0\u67e5\u7f51\u7edc\u8fde\u63a5\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u786e\u4fdd\u7f51\u7edc\u8fde\u63a5\u6b63\u5e38\uff0c\u56e0\u4e3aJupyter Notebook\u9700\u8981\u901a\u8fc7\u6d4f\u89c8\u5668\u8bbf\u95ee\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h3>\u516d\u3001Python\u4ea4\u4e92\u6a21\u5f0f\u7684\u9ad8\u7ea7\u7528\u6cd5<\/h3>\n<\/p>\n<p><p>\u9664\u4e86\u57fa\u672c\u7528\u6cd5\u5916\uff0cPython\u4ea4\u4e92\u6a21\u5f0f\u8fd8\u652f\u6301\u4e00\u4e9b\u9ad8\u7ea7\u7528\u6cd5\uff0c\u53ef\u4ee5\u63d0\u9ad8\u5f00\u53d1\u6548\u7387\u548c\u4f53\u9a8c\u3002<\/p>\n<\/p>\n<p><h4>1. \u4f7f\u7528\u9b54\u672f\u547d\u4ee4<\/h4>\n<\/p>\n<p><p>\u5728IPython\u548cJupyter Notebook\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u9b54\u672f\u547d\u4ee4\uff08Magic Commands\uff09\u6765\u6267\u884c\u4e00\u4e9b\u5e38\u89c1\u4efb\u52a1\u3002\u9b54\u672f\u547d\u4ee4\u4ee5<code>%<\/code>\u6216<code>%%<\/code>\u5f00\u5934\uff0c\u53ef\u4ee5\u5355\u884c\u6216\u591a\u884c\u4f7f\u7528\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u67e5\u770b\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55<\/p>\n<p>%pwd<\/p>\n<h2><strong>\u5217\u51fa\u5f53\u524d\u76ee\u5f55\u4e2d\u7684\u6587\u4ef6\u548c\u6587\u4ef6\u5939<\/strong><\/h2>\n<p>%ls<\/p>\n<h2><strong>\u8ba1\u65f6\u4ee3\u7801\u6267\u884c\u65f6\u95f4<\/strong><\/h2>\n<p>%timeit sum(range(1000))<\/p>\n<h2><strong>\u8fd0\u884cShell\u547d\u4ee4<\/strong><\/h2>\n<p>!ls<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u81ea\u52a8\u8865\u5168\u548c\u5386\u53f2\u8bb0\u5f55<\/h4>\n<\/p>\n<p><p>\u5728Python\u4ea4\u4e92\u6a21\u5f0f\u4e0b\uff0c\u53ef\u4ee5\u4f7f\u7528Tab\u952e\u8fdb\u884c\u81ea\u52a8\u8865\u5168\uff0c\u65b9\u4fbf\u5feb\u901f\u8f93\u5165\u53d8\u91cf\u548c\u51fd\u6570\u540d\u79f0\u3002\u6b64\u5916\uff0c\u53ef\u4ee5\u4f7f\u7528\u4e0a\u4e0b\u7bad\u5934\u952e\u6d4f\u89c8\u5386\u53f2\u547d\u4ee4\u8bb0\u5f55\uff0c\u91cd\u590d\u6267\u884c\u4e4b\u524d\u8f93\u5165\u7684\u547d\u4ee4\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">&gt;&gt;&gt; import numpy as np<\/p>\n<p>&gt;&gt;&gt; np.a  # \u6309\u4e0bTab\u952e\u81ea\u52a8\u8865\u5168<\/p>\n<p>&gt;&gt;&gt; np.array([1, 2, 3])<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3. \u4f7f\u7528\u4ea4\u4e92\u5f0f\u8c03\u8bd5\u5668<\/h4>\n<\/p>\n<p><p>\u5728Python\u4ea4\u4e92\u6a21\u5f0f\u4e0b\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ea4\u4e92\u5f0f\u8c03\u8bd5\u5668\uff08\u5982<code>pdb<\/code>\uff09\u6765\u8c03\u8bd5\u4ee3\u7801\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">&gt;&gt;&gt; import pdb<\/p>\n<p>&gt;&gt;&gt; def buggy_function(x, y):<\/p>\n<p>...     result = x \/ y<\/p>\n<p>...     return result<\/p>\n<p>...<\/p>\n<p>&gt;&gt;&gt; pdb.run(&#39;buggy_function(10, 0)&#39;)<\/p>\n<p>&gt; &lt;string&gt;(1)&lt;module&gt;()<\/p>\n<p>(Pdb) n<\/p>\n<p>&gt; &lt;string&gt;(1)&lt;module&gt;()<\/p>\n<p>(Pdb) c<\/p>\n<p>ZeroDivisionError: division by zero<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u8c03\u8bd5\u5668\uff0c\u53ef\u4ee5\u9010\u6b65\u6267\u884c\u4ee3\u7801\uff0c\u68c0\u67e5\u53d8\u91cf\u503c\uff0c\u53d1\u73b0\u548c\u89e3\u51b3\u95ee\u9898\u3002<\/p>\n<\/p>\n<p><h3>\u4e03\u3001Python\u4ea4\u4e92\u6a21\u5f0f\u7684\u5e94\u7528\u573a\u666f<\/h3>\n<\/p>\n<p><p>Python\u4ea4\u4e92\u6a21\u5f0f\u5728\u591a\u4e2a\u5e94\u7528\u573a\u666f\u4e2d\u975e\u5e38\u6709\u7528\uff0c\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5178\u578b\u5e94\u7528\u573a\u666f\uff1a<\/p>\n<\/p>\n<p><h4>1. \u6570\u636e\u5206\u6790\u548c\u79d1\u5b66\u8ba1\u7b97<\/h4>\n<\/p>\n<p><p>Python\u4ea4\u4e92\u6a21\u5f0f\u975e\u5e38\u9002\u7528\u4e8e\u6570\u636e\u5206\u6790\u548c\u79d1\u5b66\u8ba1\u7b97\u3002\u901a\u8fc7\u4ea4\u4e92\u6a21\u5f0f\uff0c\u53ef\u4ee5\u5feb\u901f\u8fdb\u884c\u6570\u636e\u63a2\u7d22\u3001\u53ef\u89c6\u5316\u548c\u8ba1\u7b97\uff0c\u7279\u522b\u662f\u5728\u4f7f\u7528NumPy\u3001Pandas\u3001Matplotlib\u7b49\u5e93\u65f6\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">&gt;&gt;&gt; import pandas as pd<\/p>\n<p>&gt;&gt;&gt; df = pd.read_csv(&#39;data.csv&#39;)<\/p>\n<p>&gt;&gt;&gt; df.head()<\/p>\n<p>&gt;&gt;&gt; df.describe()<\/p>\n<p>&gt;&gt;&gt; df.plot()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u6559\u5b66\u548c\u5b66\u4e60<\/h4>\n<\/p>\n<p><p>Python\u4ea4\u4e92\u6a21\u5f0f\u662f\u5b66\u4e60\u548c\u6559\u5b66Python\u7684\u7406\u60f3\u5de5\u5177\u3002\u901a\u8fc7\u4ea4\u4e92\u6a21\u5f0f\uff0c\u5b66\u751f\u53ef\u4ee5\u7acb\u5373\u770b\u5230\u4ee3\u7801\u6267\u884c\u7ed3\u679c\uff0c\u7406\u89e3\u7f16\u7a0b\u6982\u5ff5\u548c\u8bed\u6cd5\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">&gt;&gt;&gt; for i in range(5):<\/p>\n<p>...     print(i)<\/p>\n<p>...<\/p>\n<p>0<\/p>\n<p>1<\/p>\n<p>2<\/p>\n<p>3<\/p>\n<p>4<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>3. \u5feb\u901f\u539f\u578b\u5f00\u53d1<\/h4>\n<\/p>\n<p><p>\u5728\u5f00\u53d1\u8fc7\u7a0b\u4e2d\uff0cPython\u4ea4\u4e92\u6a21\u5f0f\u53ef\u4ee5\u7528\u4e8e\u5feb\u901f\u539f\u578b\u5f00\u53d1\u548c\u6d4b\u8bd5\u3002\u901a\u8fc7\u4ea4\u4e92\u6a21\u5f0f\uff0c\u53ef\u4ee5\u5feb\u901f\u9a8c\u8bc1\u60f3\u6cd5\u548c\u7b97\u6cd5\uff0c\u8fdb\u884c\u5355\u5143\u6d4b\u8bd5\u548c\u8c03\u8bd5\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">&gt;&gt;&gt; def factorial(n):<\/p>\n<p>...     if n == 0:<\/p>\n<p>...         return 1<\/p>\n<p>...     else:<\/p>\n<p>...         return n * factorial(n-1)<\/p>\n<p>...<\/p>\n<p>&gt;&gt;&gt; factorial(5)<\/p>\n<p>120<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>4. \u81ea\u52a8\u5316\u811a\u672c\u548c\u4efb\u52a1<\/h4>\n<\/p>\n<p><p>Python\u4ea4\u4e92\u6a21\u5f0f\u53ef\u4ee5\u7528\u4e8e\u7f16\u5199\u548c\u6d4b\u8bd5\u81ea\u52a8\u5316\u811a\u672c\u548c\u4efb\u52a1\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ea4\u4e92\u6a21\u5f0f\u7f16\u5199\u548c\u6d4b\u8bd5\u6587\u4ef6\u64cd\u4f5c\u3001\u7f51\u7edc\u8bf7\u6c42\u3001\u6570\u636e\u5e93\u67e5\u8be2\u7b49\u4efb\u52a1\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">&gt;&gt;&gt; import os<\/p>\n<p>&gt;&gt;&gt; os.listdir(&#39;.&#39;)<\/p>\n<p>&gt;&gt;&gt; with open(&#39;example.txt&#39;, &#39;w&#39;) as f:<\/p>\n<p>...     f.write(&#39;Hello, World!&#39;)<\/p>\n<p>...<\/p>\n<p>&gt;&gt;&gt; import requests<\/p>\n<p>&gt;&gt;&gt; response = requests.get(&#39;https:\/\/api.github.com&#39;)<\/p>\n<p>&gt;&gt;&gt; response.json()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u516b\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>Python\u4ea4\u4e92\u6a21\u5f0f\u662fPython\u7f16\u7a0b\u7684\u91cd\u8981\u5de5\u5177\uff0c\u63d0\u4f9b\u4e86\u65b9\u4fbf\u5feb\u6377\u7684\u4ea4\u4e92\u5f0f\u7f16\u7a0b\u73af\u5883\u3002\u901a\u8fc7\u547d\u4ee4\u884c\u3001\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u548cJupyter Notebook\u7b49\u591a\u79cd\u65b9\u5f0f\uff0c\u53ef\u4ee5\u8f7b\u677e\u6253\u5f00Python\u4ea4\u4e92\u6a21\u5f0f\uff0c\u5e76\u8fdb\u884c\u4ee3\u7801\u7f16\u5199\u548c\u6d4b\u8bd5\u3002\u5728\u6570\u636e\u5206\u6790\u3001\u79d1\u5b66\u8ba1\u7b97\u3001\u6559\u5b66\u548c\u5b66\u4e60\u3001\u5feb\u901f\u539f\u578b\u5f00\u53d1\u548c\u81ea\u52a8\u5316\u811a\u672c\u7b49\u5e94\u7528\u573a\u666f\u4e2d\uff0cPython\u4ea4\u4e92\u6a21\u5f0f\u53d1\u6325\u4e86\u91cd\u8981\u4f5c\u7528\u3002\u638c\u63e1Python\u4ea4\u4e92\u6a21\u5f0f\u7684\u57fa\u672c\u7528\u6cd5\u548c\u9ad8\u7ea7\u6280\u5de7\uff0c\u53ef\u4ee5\u6781\u5927\u63d0\u9ad8\u5f00\u53d1\u6548\u7387\u548c\u7f16\u7a0b\u4f53\u9a8c\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728\u4e0d\u540c\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u542f\u52a8Python\u7684\u4ea4\u4e92\u6a21\u5f0f\uff1f<\/strong><br \/>\u5728Windows\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u8f93\u5165<code>python<\/code>\u6216<code>py<\/code>\u6765\u542f\u52a8Python\u7684\u4ea4\u4e92\u6a21\u5f0f\u3002\u5982\u679c\u60a8\u4f7f\u7528\u7684\u662fmacOS\u6216Linux\uff0c\u53ea\u9700\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165<code>python3<\/code>\u6216<code>python<\/code>\uff08\u5177\u4f53\u53d6\u51b3\u4e8e\u60a8\u7684Python\u5b89\u88c5\uff09\u5373\u53ef\u8fdb\u5165\u4ea4\u4e92\u6a21\u5f0f\u3002\u786e\u4fdd\u60a8\u7684\u7cfb\u7edf\u5df2\u7ecf\u6b63\u786e\u5b89\u88c5\u4e86Python\uff0c\u5e76\u4e14\u73af\u5883\u53d8\u91cf\u8bbe\u7f6e\u5df2\u5b8c\u6210\u3002<\/p>\n<p><strong>\u5728Python\u4ea4\u4e92\u6a21\u5f0f\u4e0b\uff0c\u6211\u53ef\u4ee5\u6267\u884c\u54ea\u4e9b\u64cd\u4f5c\uff1f<\/strong><br \/>\u5728Python\u7684\u4ea4\u4e92\u6a21\u5f0f\u4e2d\uff0c\u60a8\u53ef\u4ee5\u76f4\u63a5\u8f93\u5165Python\u4ee3\u7801\u5e76\u7acb\u5373\u770b\u5230\u7ed3\u679c\u3002\u8fd9\u4f7f\u5f97\u6d4b\u8bd5\u5c0f\u6bb5\u4ee3\u7801\u3001\u8c03\u8bd5\u548c\u5c1d\u8bd5\u65b0\u529f\u80fd\u53d8\u5f97\u975e\u5e38\u65b9\u4fbf\u3002\u60a8\u53ef\u4ee5\u5b9a\u4e49\u53d8\u91cf\u3001\u521b\u5efa\u51fd\u6570\u3001\u5bfc\u5165\u6a21\u5757\u7b49\uff0c\u6240\u6709\u64cd\u4f5c\u90fd\u4f1a\u5b9e\u65f6\u53cd\u9988\u7ed3\u679c\uff0c\u975e\u5e38\u9002\u5408\u5b66\u4e60\u548c\u5b9e\u9a8c\u3002<\/p>\n<p><strong>\u5982\u4f55\u9000\u51faPython\u7684\u4ea4\u4e92\u6a21\u5f0f\uff1f<\/strong><br \/>\u60a8\u53ef\u4ee5\u901a\u8fc7\u8f93\u5165<code>exit()<\/code>\u6216\u4f7f\u7528\u5feb\u6377\u952e<code>Ctrl + Z<\/code>\uff08\u5728Windows\u4e0a\uff09\u6216<code>Ctrl + D<\/code>\uff08\u5728macOS\/Linux\u4e0a\uff09\u6765\u5b89\u5168\u9000\u51faPython\u7684\u4ea4\u4e92\u6a21\u5f0f\u3002\u8fd9\u5c06\u5173\u95ed\u4ea4\u4e92\u4f1a\u8bdd\u5e76\u8fd4\u56de\u5230\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u754c\u9762\u3002\u786e\u4fdd\u5728\u9000\u51fa\u4e4b\u524d\u4fdd\u5b58\u60a8\u53ef\u80fd\u9700\u8981\u7684\u4efb\u4f55\u4ee3\u7801\u6216\u6570\u636e\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u6253\u5f00Python\u4ea4\u4e92\u6a21\u5f0f\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\uff0c\u6700\u5e38\u89c1\u7684\u6709\u4ee5\u4e0b\u51e0\u79cd\uff1a\u76f4\u63a5\u5728\u547d\u4ee4\u884c\u8f93\u5165python\u3001\u901a\u8fc7\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08 [&hellip;]","protected":false},"author":3,"featured_media":1162381,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1162374"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=1162374"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1162374\/revisions"}],"predecessor-version":[{"id":1162382,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1162374\/revisions\/1162382"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1162381"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1162374"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1162374"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1162374"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}