{"id":1174286,"date":"2025-01-15T17:15:35","date_gmt":"2025-01-15T09:15:35","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1174286.html"},"modified":"2025-01-15T17:15:37","modified_gmt":"2025-01-15T09:15:37","slug":"python%e5%a6%82%e4%bd%95%e6%98%be%e7%a4%ba%e6%96%87%e4%bb%b6%e4%bf%a1%e6%81%af-2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1174286.html","title":{"rendered":"python\u5982\u4f55\u663e\u793a\u6587\u4ef6\u4fe1\u606f"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/26075828\/bf765c57-f57c-4ce6-a5dc-1d5c7230e8ff.webp\" alt=\"python\u5982\u4f55\u663e\u793a\u6587\u4ef6\u4fe1\u606f\" \/><\/p>\n<p><p> <strong>Python\u663e\u793a\u6587\u4ef6\u4fe1\u606f\u53ef\u4ee5\u4f7f\u7528\u591a\u79cd\u65b9\u6cd5\uff0c\u5982os\u6a21\u5757\u3001os.path\u6a21\u5757\u3001shutil\u6a21\u5757\u3001pathlib\u6a21\u5757\u3001stat\u6a21\u5757\u7b49<\/strong>\u3002\u5176\u4e2d\uff0c<strong>os\u6a21\u5757\u548cos.path\u6a21\u5757\u662f\u6700\u5e38\u7528\u7684<\/strong>\uff0c\u56e0\u4e3a\u5b83\u4eec\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u51fd\u6570\u6765\u83b7\u53d6\u6587\u4ef6\u7684\u5404\u79cd\u4fe1\u606f\u3002<strong>pathlib\u6a21\u5757<\/strong>\u662fPython 3.4\u5f15\u5165\u7684\u65b0\u6a21\u5757\uff0c\u63d0\u4f9b\u4e86\u9762\u5411\u5bf9\u8c61\u7684\u65b9\u5f0f\u6765\u5904\u7406\u6587\u4ef6\u7cfb\u7edf\u8def\u5f84\u3002\u4e0b\u9762\uff0c\u6211\u4eec\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u8fd9\u4e9b\u65b9\u6cd5\u4e2d\u7684\u4e00\u79cd\u3002<\/p>\n<\/p>\n<p><p><strong>os\u6a21\u5757<\/strong>\uff1aos\u6a21\u5757\u662fPython\u6807\u51c6\u5e93\u4e2d\u7684\u4e00\u4e2a\u6a21\u5757\uff0c\u63d0\u4f9b\u4e86\u4e0e\u64cd\u4f5c\u7cfb\u7edf\u8fdb\u884c\u4ea4\u4e92\u7684\u51fd\u6570\uff0c\u6bd4\u5982\u83b7\u53d6\u6587\u4ef6\u7684\u5927\u5c0f\u3001\u4fee\u6539\u65f6\u95f4\u3001\u521b\u5efa\u65f6\u95f4\u3001\u6743\u9650\u7b49\u3002os\u6a21\u5757\u63d0\u4f9b\u7684\u51fd\u6570\u5927\u591a\u662f\u76f4\u63a5\u8c03\u7528\u64cd\u4f5c\u7cfb\u7edf\u7684API\uff0c\u56e0\u6b64\u529f\u80fd\u975e\u5e38\u5f3a\u5927\u3002<\/p>\n<\/p>\n<p><h2>\u4e00\u3001\u4f7f\u7528os\u6a21\u5757\u83b7\u53d6\u6587\u4ef6\u4fe1\u606f<\/h2>\n<\/p>\n<p><h3>\u83b7\u53d6\u6587\u4ef6\u5927\u5c0f<\/h3>\n<\/p>\n<p><p>\u4f7f\u7528os\u6a21\u5757\u4e2d\u7684os.path.getsize()\u51fd\u6570\u53ef\u4ee5\u83b7\u53d6\u6587\u4ef6\u7684\u5927\u5c0f\u3002\u8fd9\u4e2a\u51fd\u6570\u63a5\u6536\u4e00\u4e2a\u6587\u4ef6\u8def\u5f84\u4f5c\u4e3a\u53c2\u6570\uff0c\u8fd4\u56de\u6587\u4ef6\u7684\u5927\u5c0f\uff08\u4ee5\u5b57\u8282\u4e3a\u5355\u4f4d\uff09\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import os<\/p>\n<p>file_path = &#39;example.txt&#39;<\/p>\n<p>file_size = os.path.getsize(file_path)<\/p>\n<p>print(f&quot;File Size: {file_size} bytes&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u83b7\u53d6\u6587\u4ef6\u7684\u521b\u5efa\u65f6\u95f4\u548c\u4fee\u6539\u65f6\u95f4<\/h3>\n<\/p>\n<p><p>os.path.getctime()\u51fd\u6570\u53ef\u4ee5\u83b7\u53d6\u6587\u4ef6\u7684\u521b\u5efa\u65f6\u95f4\uff0c\u800cos.path.getmtime()\u51fd\u6570\u53ef\u4ee5\u83b7\u53d6\u6587\u4ef6\u7684\u4fee\u6539\u65f6\u95f4\u3002\u8fd4\u56de\u7684\u65f6\u95f4\u662f\u81ea\u7eaa\u5143\u4ee5\u6765\u7684\u79d2\u6570\uff0c\u53ef\u4ee5\u4f7f\u7528time\u6a21\u5757\u5c06\u5176\u8f6c\u6362\u4e3a\u53ef\u8bfb\u7684\u65f6\u95f4\u683c\u5f0f\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import os<\/p>\n<p>import time<\/p>\n<p>file_path = &#39;example.txt&#39;<\/p>\n<h2><strong>\u83b7\u53d6\u6587\u4ef6\u7684\u521b\u5efa\u65f6\u95f4<\/strong><\/h2>\n<p>creation_time = os.path.getctime(file_path)<\/p>\n<p>print(f&quot;Creation Time: {time.ctime(creation_time)}&quot;)<\/p>\n<h2><strong>\u83b7\u53d6\u6587\u4ef6\u7684\u4fee\u6539\u65f6\u95f4<\/strong><\/h2>\n<p>modification_time = os.path.getmtime(file_path)<\/p>\n<p>print(f&quot;Modification Time: {time.ctime(modification_time)}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u83b7\u53d6\u6587\u4ef6\u7684\u6743\u9650<\/h3>\n<\/p>\n<p><p>\u4f7f\u7528os.stat()\u51fd\u6570\u53ef\u4ee5\u83b7\u53d6\u6587\u4ef6\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u5305\u62ec\u6587\u4ef6\u7684\u6743\u9650\u3002os.stat()\u51fd\u6570\u8fd4\u56de\u4e00\u4e2a\u5305\u542b\u6587\u4ef6\u8be6\u7ec6\u4fe1\u606f\u7684\u5bf9\u8c61\uff0c\u901a\u8fc7\u8be5\u5bf9\u8c61\u7684st_mode\u5c5e\u6027\u53ef\u4ee5\u83b7\u53d6\u6587\u4ef6\u7684\u6743\u9650\u4fe1\u606f\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import os<\/p>\n<p>file_path = &#39;example.txt&#39;<\/p>\n<p>file_info = os.stat(file_path)<\/p>\n<p>file_permissions = file_info.st_mode<\/p>\n<p>print(f&quot;File Permissions: {oct(file_permissions)}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>\u4e8c\u3001\u4f7f\u7528os.path\u6a21\u5757\u83b7\u53d6\u6587\u4ef6\u4fe1\u606f<\/h2>\n<\/p>\n<p><h3>\u68c0\u67e5\u6587\u4ef6\u662f\u5426\u5b58\u5728<\/h3>\n<\/p>\n<p><p>\u4f7f\u7528os.path.exists()\u51fd\u6570\u53ef\u4ee5\u68c0\u67e5\u6587\u4ef6\u662f\u5426\u5b58\u5728\u3002\u8fd9\u4e2a\u51fd\u6570\u63a5\u6536\u4e00\u4e2a\u6587\u4ef6\u8def\u5f84\u4f5c\u4e3a\u53c2\u6570\uff0c\u8fd4\u56de\u4e00\u4e2a\u5e03\u5c14\u503c\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import os<\/p>\n<p>file_path = &#39;example.txt&#39;<\/p>\n<p>file_exists = os.path.exists(file_path)<\/p>\n<p>print(f&quot;File Exists: {file_exists}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u68c0\u67e5\u662f\u5426\u662f\u6587\u4ef6\u6216\u76ee\u5f55<\/h3>\n<\/p>\n<p><p>\u4f7f\u7528os.path.isfile()\u51fd\u6570\u53ef\u4ee5\u68c0\u67e5\u8def\u5f84\u662f\u5426\u662f\u6587\u4ef6\uff0c\u4f7f\u7528os.path.isdir()\u51fd\u6570\u53ef\u4ee5\u68c0\u67e5\u8def\u5f84\u662f\u5426\u662f\u76ee\u5f55\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import os<\/p>\n<p>file_path = &#39;example.txt&#39;<\/p>\n<p>is_file = os.path.isfile(file_path)<\/p>\n<p>print(f&quot;Is File: {is_file}&quot;)<\/p>\n<p>directory_path = &#39;example_directory&#39;<\/p>\n<p>is_directory = os.path.isdir(directory_path)<\/p>\n<p>print(f&quot;Is Directory: {is_directory}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u83b7\u53d6\u6587\u4ef6\u7684\u7edd\u5bf9\u8def\u5f84\u548c\u89c4\u8303\u8def\u5f84<\/h3>\n<\/p>\n<p><p>\u4f7f\u7528os.path.abspath()\u51fd\u6570\u53ef\u4ee5\u83b7\u53d6\u6587\u4ef6\u7684\u7edd\u5bf9\u8def\u5f84\uff0c\u4f7f\u7528os.path.realpath()\u51fd\u6570\u53ef\u4ee5\u83b7\u53d6\u6587\u4ef6\u7684\u89c4\u8303\u8def\u5f84\uff08\u5373\u89e3\u6790\u7b26\u53f7\u94fe\u63a5\u540e\u7684\u8def\u5f84\uff09\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import os<\/p>\n<p>file_path = &#39;example.txt&#39;<\/p>\n<h2><strong>\u83b7\u53d6\u6587\u4ef6\u7684\u7edd\u5bf9\u8def\u5f84<\/strong><\/h2>\n<p>absolute_path = os.path.abspath(file_path)<\/p>\n<p>print(f&quot;Absolute Path: {absolute_path}&quot;)<\/p>\n<h2><strong>\u83b7\u53d6\u6587\u4ef6\u7684\u89c4\u8303\u8def\u5f84<\/strong><\/h2>\n<p>real_path = os.path.realpath(file_path)<\/p>\n<p>print(f&quot;Real Path: {real_path}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>\u4e09\u3001\u4f7f\u7528shutil\u6a21\u5757\u83b7\u53d6\u6587\u4ef6\u4fe1\u606f<\/h2>\n<\/p>\n<p><h3>\u83b7\u53d6\u6587\u4ef6\u7684\u4f7f\u7528\u60c5\u51b5<\/h3>\n<\/p>\n<p><p>shutil\u6a21\u5757\u63d0\u4f9b\u4e86shutil.disk_usage()\u51fd\u6570\uff0c\u53ef\u4ee5\u83b7\u53d6\u6587\u4ef6\u6240\u5728\u78c1\u76d8\u7684\u4f7f\u7528\u60c5\u51b5\u3002\u8fd9\u4e2a\u51fd\u6570\u8fd4\u56de\u4e00\u4e2a\u5305\u542b\u78c1\u76d8\u603b\u5bb9\u91cf\u3001\u5df2\u7528\u7a7a\u95f4\u548c\u53ef\u7528\u7a7a\u95f4\u7684\u5bf9\u8c61\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import shutil<\/p>\n<p>file_path = &#39;example.txt&#39;<\/p>\n<p>disk_usage = shutil.disk_usage(file_path)<\/p>\n<p>print(f&quot;Total: {disk_usage.total} bytes&quot;)<\/p>\n<p>print(f&quot;Used: {disk_usage.used} bytes&quot;)<\/p>\n<p>print(f&quot;Free: {disk_usage.free} bytes&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>\u56db\u3001\u4f7f\u7528pathlib\u6a21\u5757\u83b7\u53d6\u6587\u4ef6\u4fe1\u606f<\/h2>\n<\/p>\n<p><p>pathlib\u6a21\u5757\u63d0\u4f9b\u4e86\u9762\u5411\u5bf9\u8c61\u7684\u65b9\u5f0f\u6765\u5904\u7406\u6587\u4ef6\u7cfb\u7edf\u8def\u5f84\uff0c\u4f7f\u5f97\u4ee3\u7801\u66f4\u52a0\u7b80\u6d01\u548c\u6613\u8bfb\u3002<\/p>\n<\/p>\n<p><h3>\u83b7\u53d6\u6587\u4ef6\u5927\u5c0f<\/h3>\n<\/p>\n<p><p>\u4f7f\u7528Path\u5bf9\u8c61\u7684stat()\u65b9\u6cd5\u53ef\u4ee5\u83b7\u53d6\u6587\u4ef6\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u901a\u8fc7st_size\u5c5e\u6027\u53ef\u4ee5\u83b7\u53d6\u6587\u4ef6\u7684\u5927\u5c0f\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from pathlib import Path<\/p>\n<p>file_path = Path(&#39;example.txt&#39;)<\/p>\n<p>file_size = file_path.stat().st_size<\/p>\n<p>print(f&quot;File Size: {file_size} bytes&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u83b7\u53d6\u6587\u4ef6\u7684\u521b\u5efa\u65f6\u95f4\u548c\u4fee\u6539\u65f6\u95f4<\/h3>\n<\/p>\n<p><p>\u4f7f\u7528Path\u5bf9\u8c61\u7684stat()\u65b9\u6cd5\u53ef\u4ee5\u83b7\u53d6\u6587\u4ef6\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u901a\u8fc7st_ctime\u5c5e\u6027\u53ef\u4ee5\u83b7\u53d6\u6587\u4ef6\u7684\u521b\u5efa\u65f6\u95f4\uff0c\u901a\u8fc7st_mtime\u5c5e\u6027\u53ef\u4ee5\u83b7\u53d6\u6587\u4ef6\u7684\u4fee\u6539\u65f6\u95f4\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from pathlib import Path<\/p>\n<p>import time<\/p>\n<p>file_path = Path(&#39;example.txt&#39;)<\/p>\n<h2><strong>\u83b7\u53d6\u6587\u4ef6\u7684\u521b\u5efa\u65f6\u95f4<\/strong><\/h2>\n<p>creation_time = file_path.stat().st_ctime<\/p>\n<p>print(f&quot;Creation Time: {time.ctime(creation_time)}&quot;)<\/p>\n<h2><strong>\u83b7\u53d6\u6587\u4ef6\u7684\u4fee\u6539\u65f6\u95f4<\/strong><\/h2>\n<p>modification_time = file_path.stat().st_mtime<\/p>\n<p>print(f&quot;Modification Time: {time.ctime(modification_time)}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u83b7\u53d6\u6587\u4ef6\u7684\u6743\u9650<\/h3>\n<\/p>\n<p><p>\u4f7f\u7528Path\u5bf9\u8c61\u7684stat()\u65b9\u6cd5\u53ef\u4ee5\u83b7\u53d6\u6587\u4ef6\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u901a\u8fc7st_mode\u5c5e\u6027\u53ef\u4ee5\u83b7\u53d6\u6587\u4ef6\u7684\u6743\u9650\u4fe1\u606f\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from pathlib import Path<\/p>\n<p>file_path = Path(&#39;example.txt&#39;)<\/p>\n<p>file_permissions = file_path.stat().st_mode<\/p>\n<p>print(f&quot;File Permissions: {oct(file_permissions)}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h2>\u4e94\u3001\u4f7f\u7528stat\u6a21\u5757\u83b7\u53d6\u6587\u4ef6\u4fe1\u606f<\/h2>\n<\/p>\n<p><p>stat\u6a21\u5757\u63d0\u4f9b\u4e86\u66f4\u52a0\u8be6\u7ec6\u7684\u6587\u4ef6\u4fe1\u606f\uff0c\u53ef\u4ee5\u4e0eos\u6a21\u5757\u7ed3\u5408\u4f7f\u7528\u3002<\/p>\n<\/p>\n<p><h3>\u83b7\u53d6\u6587\u4ef6\u7684\u8be6\u7ec6\u4fe1\u606f<\/h3>\n<\/p>\n<p><p>\u4f7f\u7528os.stat()\u51fd\u6570\u53ef\u4ee5\u83b7\u53d6\u6587\u4ef6\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u8fd4\u56de\u7684\u5bf9\u8c61\u5305\u542b\u4e86\u6587\u4ef6\u7684\u5404\u79cd\u5c5e\u6027\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import os<\/p>\n<p>import stat<\/p>\n<p>file_path = &#39;example.txt&#39;<\/p>\n<p>file_info = os.stat(file_path)<\/p>\n<h2><strong>\u83b7\u53d6\u6587\u4ef6\u7684\u8be6\u7ec6\u4fe1\u606f<\/strong><\/h2>\n<p>print(f&quot;File Size: {file_info.st_size} bytes&quot;)<\/p>\n<p>print(f&quot;Creation Time: {time.ctime(file_info.st_ctime)}&quot;)<\/p>\n<p>print(f&quot;Modification Time: {time.ctime(file_info.st_mtime)}&quot;)<\/p>\n<p>print(f&quot;File Permissions: {oct(file_info.st_mode)}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u65b9\u6cd5\uff0c\u60a8\u53ef\u4ee5\u83b7\u53d6\u6587\u4ef6\u7684\u5404\u79cd\u4fe1\u606f\uff0c\u5305\u62ec\u5927\u5c0f\u3001\u521b\u5efa\u65f6\u95f4\u3001\u4fee\u6539\u65f6\u95f4\u3001\u6743\u9650\u7b49\u3002\u8fd9\u4e9b\u65b9\u6cd5\u9002\u7528\u4e8e\u4e0d\u540c\u7684\u573a\u666f\uff0c\u53ef\u4ee5\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u65b9\u5f0f\u6765\u83b7\u53d6\u6587\u4ef6\u4fe1\u606f\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u4f7f\u7528Python\u83b7\u53d6\u6587\u4ef6\u7684\u5927\u5c0f\u548c\u7c7b\u578b\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>os<\/code>\u6a21\u5757\u548c<code>mimetypes<\/code>\u6a21\u5757\u6765\u83b7\u53d6\u6587\u4ef6\u7684\u5927\u5c0f\u548c\u7c7b\u578b\u3002\u901a\u8fc7<code>os.path.getsize(file_path)<\/code>\u53ef\u4ee5\u5f97\u5230\u6587\u4ef6\u7684\u5b57\u8282\u5927\u5c0f\uff0c\u800c\u4f7f\u7528<code>mimetypes.guess_type(file_path)<\/code>\u53ef\u4ee5\u63a8\u6d4b\u6587\u4ef6\u7684MIME\u7c7b\u578b\u3002\u8fd9\u4e9b\u65b9\u6cd5\u7ed3\u5408\u4f7f\u7528\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u83b7\u53d6\u6587\u4ef6\u7684\u57fa\u672c\u4fe1\u606f\u3002<\/p>\n<p><strong>\u6211\u53ef\u4ee5\u4f7f\u7528\u54ea\u4e9bPython\u5e93\u6765\u8bfb\u53d6\u6587\u4ef6\u7684\u8be6\u7ec6\u4fe1\u606f\uff1f<\/strong><br \/>\u9664\u4e86<code>os<\/code>\u548c<code>mimetypes<\/code>\uff0c<code>pathlib<\/code>\u5e93\u4e5f\u63d0\u4f9b\u4e86\u83b7\u53d6\u6587\u4ef6\u4fe1\u606f\u7684\u7b80\u4fbf\u65b9\u6cd5\u3002\u4f7f\u7528<code>Path(file_path).stat()<\/code>\u53ef\u4ee5\u83b7\u5f97\u6587\u4ef6\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u5305\u62ec\u5927\u5c0f\u3001\u521b\u5efa\u65f6\u95f4\u548c\u4fee\u6539\u65f6\u95f4\u7b49\u3002\u6b64\u5916\uff0c<code>pandas<\/code>\u5e93\u53ef\u4ee5\u7528\u4e8e\u8bfb\u53d6CSV\u6587\u4ef6\u7b49\u683c\u5f0f\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u63d0\u4f9b\u4e86\u66f4\u4e30\u5bcc\u7684\u6570\u636e\u5904\u7406\u529f\u80fd\u3002<\/p>\n<p><strong>\u5982\u4f55\u68c0\u67e5\u4e00\u4e2a\u6587\u4ef6\u662f\u5426\u5b58\u5728\u4ee5\u53ca\u5176\u76f8\u5173\u4fe1\u606f\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>os.path.exists(file_path)<\/code>\u6765\u68c0\u67e5\u6587\u4ef6\u662f\u5426\u5b58\u5728\u3002\u5982\u679c\u6587\u4ef6\u5b58\u5728\uff0c\u63a5\u4e0b\u6765\u53ef\u4ee5\u4f7f\u7528<code>os.stat(file_path)<\/code>\u83b7\u53d6\u66f4\u8be6\u7ec6\u7684\u4fe1\u606f\uff0c\u5982\u6587\u4ef6\u7684\u5927\u5c0f\u3001\u521b\u5efa\u65f6\u95f4\u548c\u4fee\u6539\u65f6\u95f4\u7b49\u3002\u8fd9\u79cd\u65b9\u6cd5\u53ef\u4ee5\u5e2e\u52a9\u7528\u6237\u5728\u5904\u7406\u6587\u4ef6\u65f6\u907f\u514d\u9519\u8bef\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u663e\u793a\u6587\u4ef6\u4fe1\u606f\u53ef\u4ee5\u4f7f\u7528\u591a\u79cd\u65b9\u6cd5\uff0c\u5982os\u6a21\u5757\u3001os.path\u6a21\u5757\u3001shutil\u6a21\u5757\u3001pathlib\u6a21\u5757 [&hellip;]","protected":false},"author":3,"featured_media":1174290,"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\/1174286"}],"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=1174286"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1174286\/revisions"}],"predecessor-version":[{"id":1174293,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1174286\/revisions\/1174293"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1174290"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1174286"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1174286"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1174286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}