{"id":989604,"date":"2024-12-27T08:12:58","date_gmt":"2024-12-27T00:12:58","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/989604.html"},"modified":"2024-12-27T08:13:00","modified_gmt":"2024-12-27T00:13:00","slug":"%e5%a6%82%e4%bd%95%e6%9f%a5%e7%9c%8bpython-os%e5%ae%89%e8%a3%85","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/989604.html","title":{"rendered":"\u5982\u4f55\u67e5\u770bpython os\u5b89\u88c5"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25064723\/fee5774e-5046-462b-9a32-26ab4128fb81.webp\" alt=\"\u5982\u4f55\u67e5\u770bpython os\u5b89\u88c5\" \/><\/p>\n<p><p> <strong>\u67e5\u770bPython os\u6a21\u5757\u662f\u5426\u5b89\u88c5\u7684\u65b9\u6cd5\u6709\uff1a\u4f7f\u7528Python\u81ea\u5e26\u7684os\u6a21\u5757\u3001\u68c0\u67e5Python\u73af\u5883\u4e2dos\u6a21\u5757\u662f\u5426\u53ef\u7528\u3001\u67e5\u770bPython\u5b89\u88c5\u8def\u5f84\u4e2d\u7684\u6807\u51c6\u5e93\u3002<\/strong> Python\u7684os\u6a21\u5757\u662f\u6807\u51c6\u5e93\u7684\u4e00\u90e8\u5206\uff0c\u56e0\u6b64\u901a\u5e38\u4e0d\u9700\u8981\u5355\u72ec\u5b89\u88c5\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06\u8be6\u7ec6\u63cf\u8ff0\u5982\u4f55\u786e\u8ba4\u548c\u4f7f\u7528os\u6a21\u5757\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u4f7f\u7528Python\u81ea\u5e26\u7684os\u6a21\u5757<\/p>\n<\/p>\n<p><p>Python\u7684os\u6a21\u5757\u662f\u64cd\u4f5c\u7cfb\u7edf\u63a5\u53e3\u7684\u4e00\u90e8\u5206\uff0c\u5b83\u63d0\u4f9b\u4e86\u4e00\u79cd\u4fbf\u6377\u7684\u65b9\u5f0f\u6765\u4e0e\u64cd\u4f5c\u7cfb\u7edf\u8fdb\u884c\u4ea4\u4e92\u3002\u56e0\u4e3aos\u662fPython\u6807\u51c6\u5e93\u7684\u4e00\u90e8\u5206\uff0c\u6240\u4ee5\u5728\u5b89\u88c5Python\u65f6\uff0cos\u6a21\u5757\u4f1a\u81ea\u52a8\u5b89\u88c5\u3002\u56e0\u6b64\uff0c\u60a8\u65e0\u9700\u62c5\u5fc3os\u6a21\u5757\u7684\u5b89\u88c5\u95ee\u9898\u3002\u8981\u67e5\u770bos\u6a21\u5757\u662f\u5426\u53ef\u7528\uff0c\u53ef\u4ee5\u901a\u8fc7\u6253\u5f00Python\u89e3\u91ca\u5668\u5e76\u5bfc\u5165os\u6a21\u5757\u6765\u8fdb\u884c\u9a8c\u8bc1\u3002\u53ea\u9700\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165<code>python<\/code>\uff0c\u7136\u540e\u5728Python\u63d0\u793a\u7b26\u4e0b\u8f93\u5165<code>import os<\/code>\u5373\u53ef\u3002\u5982\u679c\u6ca1\u6709\u51fa\u73b0\u9519\u8bef\uff0c\u5219\u8868\u793aos\u6a21\u5757\u5df2\u6b63\u786e\u5b89\u88c5\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import os<\/p>\n<p>print(os.name)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5982\u679c\u4e0a\u8ff0\u4ee3\u7801\u6267\u884c\u6ca1\u6709\u62a5\u9519\uff0c\u5e76\u4e14\u8f93\u51fa\u4e86\u4e0e\u64cd\u4f5c\u7cfb\u7edf\u76f8\u5173\u7684\u4fe1\u606f\uff08\u4f8b\u5982\u5728Windows\u4e0a\u8f93\u51fa<code>nt<\/code>\uff0c\u5728Unix\/Linux\u4e0a\u8f93\u51fa<code>posix<\/code>\uff09\uff0c\u5219\u8bf4\u660eos\u6a21\u5757\u5df2\u7ecf\u5b89\u88c5\u4e14\u53ef\u4ee5\u6b63\u5e38\u4f7f\u7528\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u68c0\u67e5Python\u73af\u5883\u4e2dos\u6a21\u5757\u662f\u5426\u53ef\u7528<\/p>\n<\/p>\n<p><p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u60a8\u53ef\u80fd\u4f1a\u4f7f\u7528\u865a\u62df\u73af\u5883\u6765\u9694\u79bb\u4e0d\u540c\u9879\u76ee\u7684\u4f9d\u8d56\u9879\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u60a8\u53ef\u80fd\u4f1a\u60f3\u786e\u8ba4os\u6a21\u5757\u5728\u5f53\u524d\u7684Python\u73af\u5883\u4e2d\u662f\u5426\u53ef\u7528\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u6b65\u9aa4\u6765\u9a8c\u8bc1\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u6fc0\u6d3b\u865a\u62df\u73af\u5883\uff08\u5982\u679c\u4f7f\u7528\u4e86\u865a\u62df\u73af\u5883\uff09\u3002<\/li>\n<li>\u6253\u5f00\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u3002<\/li>\n<li>\u542f\u52a8Python\u89e3\u91ca\u5668\u3002<\/li>\n<li>\u8f93\u5165<code>import os<\/code>\u5e76\u89c2\u5bdf\u662f\u5426\u6709\u9519\u8bef\u4fe1\u606f\u3002<\/li>\n<\/ol>\n<p><p>\u5982\u679c\u6ca1\u6709\u9519\u8bef\u4fe1\u606f\uff0c\u5219\u8bf4\u660eos\u6a21\u5757\u5728\u5f53\u524d\u7684Python\u73af\u5883\u4e2d\u662f\u53ef\u7528\u7684\u3002<\/p>\n<\/p>\n<p><p>\u4e09\u3001\u67e5\u770bPython\u5b89\u88c5\u8def\u5f84\u4e2d\u7684\u6807\u51c6\u5e93<\/p>\n<\/p>\n<p><p>\u5728\u5927\u591a\u6570\u60c5\u51b5\u4e0b\uff0cos\u6a21\u5757\u4f1a\u88ab\u81ea\u52a8\u5305\u542b\u5728Python\u7684\u6807\u51c6\u5e93\u4e2d\u3002\u5982\u679c\u60a8\u60f3\u786e\u8ba4os\u6a21\u5757\u662f\u5426\u5b58\u5728\u4e8e\u6807\u51c6\u5e93\u4e2d\uff0c\u60a8\u53ef\u4ee5\u67e5\u770bPython\u5b89\u88c5\u8def\u5f84\u4e2d\u7684<code>Lib<\/code>\u76ee\u5f55\u3002\u8fd9\u4e2a\u76ee\u5f55\u5305\u542b\u4e86\u6240\u6709\u7684\u6807\u51c6\u5e93\u6a21\u5757\u3002<\/p>\n<\/p>\n<ol>\n<li>\u67e5\u627ePython\u5b89\u88c5\u8def\u5f84\u3002\u8fd9\u901a\u5e38\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u547d\u4ee4<code>which python<\/code>\uff08\u5728Unix\/Linux\/Mac\u4e0a\uff09\u6216<code>where python<\/code>\uff08\u5728Windows\u4e0a\uff09\u6765\u786e\u5b9a\u3002<\/li>\n<li>\u5bfc\u822a\u5230\u5b89\u88c5\u8def\u5f84\u4e2d\u7684<code>Lib<\/code>\u76ee\u5f55\u3002<\/li>\n<li>\u5728\u8be5\u76ee\u5f55\u4e0b\u67e5\u627e\u540d\u4e3a<code>os.py<\/code>\u7684\u6587\u4ef6\u3002<\/li>\n<\/ol>\n<p><p>\u5982\u679c\u627e\u5230\u4e86<code>os.py<\/code>\u6587\u4ef6\uff0c\u5219\u8bf4\u660eos\u6a21\u5757\u662f\u5b58\u5728\u5e76\u53ef\u7528\u7684\u3002<\/p>\n<\/p>\n<p><p>\u56db\u3001os\u6a21\u5757\u7684\u5e38\u7528\u529f\u80fd\u4ecb\u7ecd<\/p>\n<\/p>\n<p><p>os\u6a21\u5757\u63d0\u4f9b\u4e86\u8bb8\u591a\u6709\u7528\u7684\u529f\u80fd\uff0c\u5141\u8bb8\u60a8\u4e0e\u64cd\u4f5c\u7cfb\u7edf\u8fdb\u884c\u5404\u79cd\u4ea4\u4e92\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u7528\u7684\u529f\u80fd\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u6587\u4ef6\u4e0e\u76ee\u5f55\u64cd\u4f5c<\/strong><\/p>\n<\/p>\n<p><p>os\u6a21\u5757\u63d0\u4f9b\u4e86\u591a\u79cd\u65b9\u6cd5\u6765\u64cd\u4f5c\u6587\u4ef6\u548c\u76ee\u5f55\u3002\u4f8b\u5982\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528<code>os.listdir()<\/code>\u6765\u5217\u51fa\u6307\u5b9a\u76ee\u5f55\u4e2d\u7684\u6240\u6709\u6587\u4ef6\u548c\u76ee\u5f55\uff0c\u4f7f\u7528<code>os.mkdir()<\/code>\u6765\u521b\u5efa\u65b0\u76ee\u5f55\uff0c\u4f7f\u7528<code>os.remove()<\/code>\u6765\u5220\u9664\u6587\u4ef6\uff0c\u4f7f\u7528<code>os.rename()<\/code>\u6765\u91cd\u547d\u540d\u6587\u4ef6\u6216\u76ee\u5f55\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import os<\/p>\n<h2><strong>\u5217\u51fa\u5f53\u524d\u76ee\u5f55\u4e2d\u7684\u6240\u6709\u6587\u4ef6\u548c\u76ee\u5f55<\/strong><\/h2>\n<p>print(os.listdir(&#39;.&#39;))<\/p>\n<h2><strong>\u521b\u5efa\u4e00\u4e2a\u65b0\u76ee\u5f55<\/strong><\/h2>\n<p>os.mkdir(&#39;new_directory&#39;)<\/p>\n<h2><strong>\u91cd\u547d\u540d\u76ee\u5f55<\/strong><\/h2>\n<p>os.rename(&#39;new_directory&#39;, &#39;renamed_directory&#39;)<\/p>\n<h2><strong>\u5220\u9664\u6587\u4ef6<\/strong><\/h2>\n<p>os.remove(&#39;example.txt&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u83b7\u53d6\u548c\u66f4\u6539\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55<\/strong><\/p>\n<\/p>\n<p><p>\u60a8\u53ef\u4ee5\u4f7f\u7528<code>os.getcwd()<\/code>\u83b7\u53d6\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55\uff0c\u5e76\u4f7f\u7528<code>os.chdir()<\/code>\u66f4\u6539\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import os<\/p>\n<h2><strong>\u83b7\u53d6\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55<\/strong><\/h2>\n<p>current_directory = os.getcwd()<\/p>\n<p>print(f&quot;\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55\u662f\uff1a{current_directory}&quot;)<\/p>\n<h2><strong>\u66f4\u6539\u5de5\u4f5c\u76ee\u5f55<\/strong><\/h2>\n<p>os.chdir(&#39;\/path\/to\/new\/directory&#39;)<\/p>\n<p>print(f&quot;\u5de5\u4f5c\u76ee\u5f55\u5df2\u66f4\u6539\u4e3a\uff1a{os.getcwd()}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u73af\u5883\u53d8\u91cf\u7684\u64cd\u4f5c<\/strong><\/p>\n<\/p>\n<p><p>os\u6a21\u5757\u5141\u8bb8\u60a8\u8bbf\u95ee\u548c\u64cd\u4f5c\u73af\u5883\u53d8\u91cf\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528<code>os.environ<\/code>\u6765\u83b7\u53d6\u73af\u5883\u53d8\u91cf\u7684\u5b57\u5178\u89c6\u56fe\uff0c\u4f7f\u7528<code>os.getenv()<\/code>\u83b7\u53d6\u7279\u5b9a\u73af\u5883\u53d8\u91cf\u7684\u503c\uff0c\u4f7f\u7528<code>os.putenv()<\/code>\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import os<\/p>\n<h2><strong>\u83b7\u53d6PATH\u73af\u5883\u53d8\u91cf<\/strong><\/h2>\n<p>path = os.getenv(&#39;PATH&#39;)<\/p>\n<p>print(f&quot;PATH: {path}&quot;)<\/p>\n<h2><strong>\u8bbe\u7f6e\u65b0\u7684\u73af\u5883\u53d8\u91cf<\/strong><\/h2>\n<p>os.putenv(&#39;NEW_VAR&#39;, &#39;value&#39;)<\/p>\n<p>print(f&quot;NEW_VAR: {os.getenv(&#39;NEW_VAR&#39;)}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u6267\u884c\u7cfb\u7edf\u547d\u4ee4<\/strong><\/p>\n<\/p>\n<p><p>os\u6a21\u5757\u5141\u8bb8\u60a8\u6267\u884c\u7cfb\u7edf\u547d\u4ee4\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528<code>os.system()<\/code>\u6765\u8fd0\u884c\u7cfb\u7edf\u547d\u4ee4\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u4f7f\u7528<code>os.system()<\/code>\u65f6\uff0c\u547d\u4ee4\u7684\u8fd4\u56de\u503c\u662f\u547d\u4ee4\u6267\u884c\u540e\u7684\u9000\u51fa\u72b6\u6001\uff0c\u800c\u4e0d\u662f\u547d\u4ee4\u7684\u8f93\u51fa\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import os<\/p>\n<h2><strong>\u6267\u884c\u7cfb\u7edf\u547d\u4ee4<\/strong><\/h2>\n<p>exit_status = os.system(&#39;echo Hello, World!&#39;)<\/p>\n<p>print(f&quot;\u547d\u4ee4\u9000\u51fa\u72b6\u6001\uff1a{exit_status}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p><strong>\u8def\u5f84\u64cd\u4f5c<\/strong><\/p>\n<\/p>\n<p><p>os\u6a21\u5757\u8fd8\u63d0\u4f9b\u4e86\u7528\u4e8e\u8def\u5f84\u64cd\u4f5c\u7684\u5b50\u6a21\u5757os.path\u3002os.path\u63d0\u4f9b\u4e86\u591a\u79cd\u51fd\u6570\u6765\u5904\u7406\u6587\u4ef6\u8def\u5f84\uff0c\u4f8b\u5982<code>os.path.join()<\/code>\u7528\u4e8e\u8fde\u63a5\u8def\u5f84\uff0c<code>os.path.exists()<\/code>\u7528\u4e8e\u68c0\u67e5\u8def\u5f84\u662f\u5426\u5b58\u5728\uff0c<code>os.path.isabs()<\/code>\u7528\u4e8e\u68c0\u67e5\u8def\u5f84\u662f\u5426\u4e3a\u7edd\u5bf9\u8def\u5f84\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import os<\/p>\n<h2><strong>\u8fde\u63a5\u8def\u5f84<\/strong><\/h2>\n<p>full_path = os.path.join(&#39;\/path\/to&#39;, &#39;directory&#39;, &#39;file.txt&#39;)<\/p>\n<p>print(f&quot;\u5b8c\u6574\u8def\u5f84\uff1a{full_path}&quot;)<\/p>\n<h2><strong>\u68c0\u67e5\u8def\u5f84\u662f\u5426\u5b58\u5728<\/strong><\/h2>\n<p>exists = os.path.exists(full_path)<\/p>\n<p>print(f&quot;\u8def\u5f84\u662f\u5426\u5b58\u5728\uff1a{exists}&quot;)<\/p>\n<h2><strong>\u68c0\u67e5\u8def\u5f84\u662f\u5426\u4e3a\u7edd\u5bf9\u8def\u5f84<\/strong><\/h2>\n<p>is_absolute = os.path.isabs(full_path)<\/p>\n<p>print(f&quot;\u8def\u5f84\u662f\u5426\u4e3a\u7edd\u5bf9\u8def\u5f84\uff1a{is_absolute}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><p>\u516d\u3001\u603b\u7ed3<\/p>\n<\/p>\n<p><p>os\u6a21\u5757\u662fPython\u6807\u51c6\u5e93\u4e2d\u4e00\u4e2a\u5f3a\u5927\u7684\u6a21\u5757\uff0c\u63d0\u4f9b\u4e86\u591a\u79cd\u529f\u80fd\u6765\u4e0e\u64cd\u4f5c\u7cfb\u7edf\u8fdb\u884c\u4ea4\u4e92\u3002\u7531\u4e8eos\u6a21\u5757\u662fPython\u6807\u51c6\u5e93\u7684\u4e00\u90e8\u5206\uff0c\u56e0\u6b64\u901a\u5e38\u65e0\u9700\u62c5\u5fc3\u5176\u5b89\u88c5\u95ee\u9898\u3002\u901a\u8fc7\u5bfc\u5165os\u6a21\u5757\u5e76\u4f7f\u7528\u5176\u63d0\u4f9b\u7684\u529f\u80fd\uff0c\u60a8\u53ef\u4ee5\u8f7b\u677e\u5b9e\u73b0\u5bf9\u6587\u4ef6\u3001\u76ee\u5f55\u3001\u73af\u5883\u53d8\u91cf\u7b49\u7684\u64cd\u4f5c\u3002\u5728\u4f7f\u7528os\u6a21\u5757\u65f6\uff0c\u5efa\u8bae\u60a8\u8be6\u7ec6\u9605\u8bfb\u5b98\u65b9\u6587\u6863\uff0c\u4ee5\u4fbf\u66f4\u597d\u5730\u7406\u89e3\u5176\u63d0\u4f9b\u7684\u529f\u80fd\u548c\u7528\u6cd5\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u786e\u8ba4\u6211\u7684Python\u73af\u5883\u4e2d\u662f\u5426\u5df2\u5b89\u88c5os\u6a21\u5757\uff1f<\/strong><br \/>\u53ef\u4ee5\u901a\u8fc7\u5728Python\u4ea4\u4e92\u5f0f\u547d\u4ee4\u884c\u4e2d\u8f93\u5165<code>import os<\/code>\u6765\u68c0\u67e5os\u6a21\u5757\u662f\u5426\u5df2\u5b89\u88c5\u3002\u5982\u679c\u6ca1\u6709\u9519\u8bef\u63d0\u793a\uff0c\u8bf4\u660eos\u6a21\u5757\u5df2\u6210\u529f\u5b89\u88c5\u5e76\u53ef\u7528\u3002\u4f60\u4e5f\u53ef\u4ee5\u5728\u4f60\u7684Python\u811a\u672c\u4e2d\u6dfb\u52a0\u8fd9\u884c\u4ee3\u7801\uff0c\u8fd0\u884c\u540e\u786e\u4fdd\u6ca1\u6709\u62a5\u9519\u3002<\/p>\n<p><strong>\u5982\u679cos\u6a21\u5757\u6ca1\u6709\u5b89\u88c5\uff0c\u6211\u8be5\u5982\u4f55\u5904\u7406\uff1f<\/strong><br \/>os\u6a21\u5757\u662fPython\u7684\u6807\u51c6\u5e93\u4e4b\u4e00\uff0c\u901a\u5e38\u60c5\u51b5\u4e0b\u4f1a\u968f\u7740Python\u7684\u5b89\u88c5\u81ea\u52a8\u5305\u542b\u3002\u5982\u679c\u4f60\u9047\u5230\u65e0\u6cd5\u5bfc\u5165os\u6a21\u5757\u7684\u60c5\u51b5\uff0c\u5efa\u8bae\u68c0\u67e5\u4f60\u7684Python\u5b89\u88c5\u662f\u5426\u5b8c\u6574\uff0c\u6216\u8003\u8651\u91cd\u65b0\u5b89\u88c5Python\u3002\u786e\u4fdd\u9009\u62e9\u6b63\u786e\u7684\u7248\u672c\u5e76\u6309\u7167\u5b98\u65b9\u6587\u6863\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n<p><strong>\u5982\u4f55\u67e5\u770b\u6211\u7684Python\u7248\u672c\u4ee5\u53caos\u6a21\u5757\u7684\u5177\u4f53\u4fe1\u606f\uff1f<\/strong><br \/>\u53ef\u4ee5\u901a\u8fc7\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165<code>python --version<\/code>\u6216<code>python3 --version<\/code>\u6765\u67e5\u770b\u4f60\u7684Python\u7248\u672c\u3002\u540c\u65f6\uff0c\u5728Python\u73af\u5883\u4e2d\uff0c\u8f93\u5165<code>import os<\/code>\u540e\u518d\u4f7f\u7528<code>print(os.__file__)<\/code>\u53ef\u4ee5\u663e\u793aos\u6a21\u5757\u7684\u5b89\u88c5\u4f4d\u7f6e\uff0c\u4f7f\u7528<code>print(os.__doc__)<\/code>\u53ef\u4ee5\u67e5\u770bos\u6a21\u5757\u7684\u6587\u6863\u5b57\u7b26\u4e32\uff0c\u83b7\u53d6\u66f4\u591a\u8be6\u7ec6\u4fe1\u606f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u67e5\u770bPython os\u6a21\u5757\u662f\u5426\u5b89\u88c5\u7684\u65b9\u6cd5\u6709\uff1a\u4f7f\u7528Python\u81ea\u5e26\u7684os\u6a21\u5757\u3001\u68c0\u67e5Python\u73af\u5883\u4e2dos\u6a21\u5757\u662f\u5426 [&hellip;]","protected":false},"author":3,"featured_media":989612,"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\/989604"}],"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=989604"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/989604\/revisions"}],"predecessor-version":[{"id":989613,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/989604\/revisions\/989613"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/989612"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=989604"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=989604"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=989604"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}