{"id":1102844,"date":"2025-01-08T16:04:09","date_gmt":"2025-01-08T08:04:09","guid":{"rendered":""},"modified":"2025-01-08T16:04:15","modified_gmt":"2025-01-08T08:04:15","slug":"%e5%a6%82%e4%bd%95%e7%94%a8python%e5%8e%bb%e4%bf%9d%e5%ad%98%e6%96%87%e4%bb%b6%e5%90%8e%e7%bc%80%e5%90%8d","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1102844.html","title":{"rendered":"\u5982\u4f55\u7528python\u53bb\u4fdd\u5b58\u6587\u4ef6\u540e\u7f00\u540d"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25064938\/982a895f-c534-44f1-9822-e310dceb057d.webp\" alt=\"\u5982\u4f55\u7528python\u53bb\u4fdd\u5b58\u6587\u4ef6\u540e\u7f00\u540d\" \/><\/p>\n<p><p> <strong>\u4f7f\u7528Python\u4fdd\u5b58\u6587\u4ef6\u540e\u7f00\u540d\u7684\u5e38\u89c1\u65b9\u6cd5\u6709\uff1aos.path\u6a21\u5757\u3001pathlib\u5e93\u3001splitext()\u51fd\u6570\u7b49\u3002<\/strong>\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528\u8fd9\u4e9b\u65b9\u6cd5\u6765\u4fdd\u5b58\u6587\u4ef6\u540e\u7f00\u540d\uff0c\u5e76\u7ed9\u51fa\u793a\u4f8b\u4ee3\u7801\u548c\u6ce8\u610f\u4e8b\u9879\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001os.path\u6a21\u5757<\/p>\n<\/p>\n<p><p>\u4f7f\u7528os.path\u6a21\u5757\u662f\u5904\u7406\u6587\u4ef6\u8def\u5f84\u548c\u6587\u4ef6\u540d\u7684\u4f20\u7edf\u65b9\u6cd5\u4e4b\u4e00\u3002os.path\u6a21\u5757\u4e2d\u63d0\u4f9b\u4e86\u591a\u4e2a\u51fd\u6570\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u64cd\u4f5c\u6587\u4ef6\u8def\u5f84\u548c\u6587\u4ef6\u540d\u3002<\/p>\n<\/p>\n<p><p>1\u3001os.path.splitext()<\/p>\n<\/p>\n<p><p>os.path.splitext()\u51fd\u6570\u53ef\u4ee5\u5c06\u6587\u4ef6\u540d\u548c\u6587\u4ef6\u540e\u7f00\u540d\u5206\u5f00\uff0c\u8fd4\u56de\u4e00\u4e2a\u5305\u542b\u6587\u4ef6\u540d\u548c\u6587\u4ef6\u540e\u7f00\u540d\u7684\u5143\u7ec4\u3002\u4f7f\u7528\u8be5\u51fd\u6570\u53ef\u4ee5\u65b9\u4fbf\u5730\u83b7\u53d6\u6587\u4ef6\u540e\u7f00\u540d\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_name, file_extension = os.path.splitext(file_path)<\/p>\n<p>print(f&quot;File name: {file_name}&quot;)<\/p>\n<p>print(f&quot;File extension: {file_extension}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8f93\u51fa\u7ed3\u679c\uff1a<\/p>\n<\/p>\n<p><pre><code>File name: example<\/p>\n<p>File extension: .txt<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u9762\u7684\u4ee3\u7801\u4e2d\uff0cos.path.splitext()\u51fd\u6570\u5c06\u6587\u4ef6\u8def\u5f84\u5206\u89e3\u4e3a\u6587\u4ef6\u540d\u548c\u6587\u4ef6\u540e\u7f00\u540d\u4e24\u4e2a\u90e8\u5206\uff0c\u7136\u540e\u6211\u4eec\u53ef\u4ee5\u5206\u522b\u5bf9\u5b83\u4eec\u8fdb\u884c\u64cd\u4f5c\u3002<\/p>\n<\/p>\n<p><p>2\u3001os.path.basename()<\/p>\n<\/p>\n<p><p>os.path.basename()\u51fd\u6570\u8fd4\u56de\u6587\u4ef6\u8def\u5f84\u4e2d\u7684\u6700\u540e\u4e00\u4e2a\u7ec4\u4ef6\uff0c\u5373\u6587\u4ef6\u540d\u3002\u7ed3\u5408os.path.splitext()\u51fd\u6570\uff0c\u53ef\u4ee5\u4ece\u5b8c\u6574\u7684\u6587\u4ef6\u8def\u5f84\u4e2d\u63d0\u53d6\u6587\u4ef6\u540e\u7f00\u540d\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import os<\/p>\n<p>file_path = &#39;\/path\/to\/example.txt&#39;<\/p>\n<p>file_name_with_extension = os.path.basename(file_path)<\/p>\n<p>file_name, file_extension = os.path.splitext(file_name_with_extension)<\/p>\n<p>print(f&quot;File name: {file_name}&quot;)<\/p>\n<p>print(f&quot;File extension: {file_extension}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8f93\u51fa\u7ed3\u679c\uff1a<\/p>\n<\/p>\n<p><pre><code>File name: example<\/p>\n<p>File extension: .txt<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e8c\u3001pathlib\u5e93<\/p>\n<\/p>\n<p><p>pathlib\u5e93\u662fPython 3.4\u5f15\u5165\u7684\u4e00\u4e2a\u65b0\u7684\u6a21\u5757\uff0c\u7528\u4e8e\u5904\u7406\u6587\u4ef6\u7cfb\u7edf\u8def\u5f84\u3002\u76f8\u6bd4\u4e8eos.path\u6a21\u5757\uff0cpathlib\u5e93\u66f4\u76f4\u89c2\u3001\u66f4\u6613\u7528\u3002<\/p>\n<\/p>\n<p><p>1\u3001Path.suffix<\/p>\n<\/p>\n<p><p>pathlib.Path\u5bf9\u8c61\u7684suffix\u5c5e\u6027\u53ef\u4ee5\u76f4\u63a5\u83b7\u53d6\u6587\u4ef6\u540e\u7f00\u540d\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_extension = file_path.suffix<\/p>\n<p>print(f&quot;File extension: {file_extension}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8f93\u51fa\u7ed3\u679c\uff1a<\/p>\n<\/p>\n<p><pre><code>File extension: .txt<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>2\u3001Path.stem<\/p>\n<\/p>\n<p><p>pathlib.Path\u5bf9\u8c61\u7684stem\u5c5e\u6027\u53ef\u4ee5\u83b7\u53d6\u6587\u4ef6\u540d\uff08\u4e0d\u5305\u62ec\u540e\u7f00\u540d\uff09\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from pathlib import Path<\/p>\n<p>file_path = Path(&#39;\/path\/to\/example.txt&#39;)<\/p>\n<p>file_name = file_path.stem<\/p>\n<p>print(f&quot;File name: {file_name}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8f93\u51fa\u7ed3\u679c\uff1a<\/p>\n<\/p>\n<p><pre><code>File name: example<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e09\u3001\u4fdd\u5b58\u6587\u4ef6\u540e\u7f00\u540d\u7684\u5b9e\u9645\u5e94\u7528<\/p>\n<\/p>\n<p><p>1\u3001\u91cd\u547d\u540d\u6587\u4ef6<\/p>\n<\/p>\n<p><p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u53ef\u80fd\u9700\u8981\u6839\u636e\u6587\u4ef6\u540e\u7f00\u540d\u6765\u91cd\u547d\u540d\u6587\u4ef6\u3002\u4f8b\u5982\uff0c\u5c06\u6240\u6709\u7684.txt\u6587\u4ef6\u91cd\u547d\u540d\u4e3a.md\u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import os<\/p>\n<p>def rename_files_in_directory(directory, old_extension, new_extension):<\/p>\n<p>    for file_name in os.listdir(directory):<\/p>\n<p>        if file_name.endswith(old_extension):<\/p>\n<p>            base_name = os.path.splitext(file_name)[0]<\/p>\n<p>            new_file_name = f&quot;{base_name}{new_extension}&quot;<\/p>\n<p>            os.rename(os.path.join(directory, file_name), os.path.join(directory, new_file_name))<\/p>\n<h2><strong>\u4f7f\u7528\u793a\u4f8b<\/strong><\/h2>\n<p>rename_files_in_directory(&#39;\/path\/to\/directory&#39;, &#39;.txt&#39;, &#39;.md&#39;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u9762\u7684\u4ee3\u7801\u4e2d\uff0crename_files_in_directory()\u51fd\u6570\u904d\u5386\u6307\u5b9a\u76ee\u5f55\u4e2d\u7684\u6240\u6709\u6587\u4ef6\uff0c\u5982\u679c\u6587\u4ef6\u4ee5\u6307\u5b9a\u7684\u65e7\u540e\u7f00\u540d\u7ed3\u5c3e\uff0c\u5219\u5c06\u5176\u91cd\u547d\u540d\u4e3a\u65b0\u7684\u540e\u7f00\u540d\u3002<\/p>\n<\/p>\n<p><p>2\u3001\u6309\u6587\u4ef6\u7c7b\u578b\u5206\u7c7b\u6587\u4ef6<\/p>\n<\/p>\n<p><p>\u6709\u65f6\u6211\u4eec\u9700\u8981\u6839\u636e\u6587\u4ef6\u540e\u7f00\u540d\u5c06\u6587\u4ef6\u5206\u7c7b\u5230\u4e0d\u540c\u7684\u6587\u4ef6\u5939\u4e2d\u3002\u4f8b\u5982\uff0c\u5c06\u6240\u6709\u7684\u56fe\u7247\u6587\u4ef6\uff08.jpg\u3001.png\uff09\u653e\u5165&quot;images&quot;\u6587\u4ef6\u5939\uff0c\u5c06\u6240\u6709\u7684\u6587\u672c\u6587\u4ef6\uff08.txt\uff09\u653e\u5165&quot;texts&quot;\u6587\u4ef6\u5939\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import os<\/p>\n<p>from pathlib import Path<\/p>\n<p>def organize_files_by_extension(directory):<\/p>\n<p>    for file_path in Path(directory).iterdir():<\/p>\n<p>        if file_path.is_file():<\/p>\n<p>            extension = file_path.suffix<\/p>\n<p>            destination_directory = directory \/ extension[1:]  # \u53bb\u6389\u524d\u9762\u7684\u70b9<\/p>\n<p>            destination_directory.mkdir(exist_ok=True)<\/p>\n<p>            file_path.rename(destination_directory \/ file_path.name)<\/p>\n<h2><strong>\u4f7f\u7528\u793a\u4f8b<\/strong><\/h2>\n<p>organize_files_by_extension(Path(&#39;\/path\/to\/directory&#39;))<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u4e0a\u9762\u7684\u4ee3\u7801\u4e2d\uff0corganize_files_by_extension()\u51fd\u6570\u904d\u5386\u6307\u5b9a\u76ee\u5f55\u4e2d\u7684\u6240\u6709\u6587\u4ef6\uff0c\u6839\u636e\u6587\u4ef6\u540e\u7f00\u540d\u521b\u5efa\u76f8\u5e94\u7684\u6587\u4ef6\u5939\uff0c\u5e76\u5c06\u6587\u4ef6\u79fb\u52a8\u5230\u5bf9\u5e94\u7684\u6587\u4ef6\u5939\u4e2d\u3002<\/p>\n<\/p>\n<p><p>\u56db\u3001\u6587\u4ef6\u540e\u7f00\u540d\u7684\u6ce8\u610f\u4e8b\u9879<\/p>\n<\/p>\n<p><p>1\u3001\u6587\u4ef6\u540e\u7f00\u540d\u7684\u5927\u5c0f\u5199<\/p>\n<\/p>\n<p><p>\u5728\u67d0\u4e9b\u6587\u4ef6\u7cfb\u7edf\u4e2d\uff0c\u6587\u4ef6\u540e\u7f00\u540d\u662f\u533a\u5206\u5927\u5c0f\u5199\u7684\u3002\u4f8b\u5982\uff0c.TXT\u548c.txt\u662f\u4e0d\u540c\u7684\u540e\u7f00\u540d\u3002\u56e0\u6b64\uff0c\u5728\u5904\u7406\u6587\u4ef6\u540e\u7f00\u540d\u65f6\uff0c\u5efa\u8bae\u7edf\u4e00\u5c06\u540e\u7f00\u540d\u8f6c\u6362\u4e3a\u5c0f\u5199\u6216\u5927\u5199\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_extension = os.path.splitext(file_path)[1].lower()<\/p>\n<p>print(f&quot;File extension: {file_extension}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8f93\u51fa\u7ed3\u679c\uff1a<\/p>\n<\/p>\n<p><pre><code>File extension: .txt<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>2\u3001\u6ca1\u6709\u540e\u7f00\u540d\u7684\u6587\u4ef6<\/p>\n<\/p>\n<p><p>\u5e76\u4e0d\u662f\u6240\u6709\u7684\u6587\u4ef6\u90fd\u6709\u540e\u7f00\u540d\u3002\u5728\u5904\u7406\u6587\u4ef6\u8def\u5f84\u65f6\uff0c\u9700\u8981\u8003\u8651\u8fd9\u79cd\u60c5\u51b5\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import os<\/p>\n<p>file_path = &#39;example&#39;<\/p>\n<p>file_name, file_extension = os.path.splitext(file_path)<\/p>\n<p>if file_extension:<\/p>\n<p>    print(f&quot;File extension: {file_extension}&quot;)<\/p>\n<p>else:<\/p>\n<p>    print(&quot;The file has no extension.&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8f93\u51fa\u7ed3\u679c\uff1a<\/p>\n<\/p>\n<p><pre><code>The file has no extension.<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>3\u3001\u591a\u4e2a\u540e\u7f00\u540d<\/p>\n<\/p>\n<p><p>\u6709\u4e9b\u6587\u4ef6\u53ef\u80fd\u6709\u591a\u4e2a\u540e\u7f00\u540d\uff0c\u4f8b\u5982.tar.gz\u6587\u4ef6\u3002\u5728\u5904\u7406\u8fd9\u79cd\u60c5\u51b5\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528rpartition()\u51fd\u6570\u6765\u83b7\u53d6\u6700\u540e\u4e00\u4e2a\u540e\u7f00\u540d\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">file_path = &#39;example.tar.gz&#39;<\/p>\n<p>base_name, _, last_extension = file_path.rpartition(&#39;.&#39;)<\/p>\n<p>print(f&quot;Last extension: {last_extension}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8f93\u51fa\u7ed3\u679c\uff1a<\/p>\n<\/p>\n<p><pre><code>Last extension: gz<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4e94\u3001\u603b\u7ed3<\/p>\n<\/p>\n<p><p>\u672c\u6587\u4ecb\u7ecd\u4e86\u4f7f\u7528Python\u4fdd\u5b58\u6587\u4ef6\u540e\u7f00\u540d\u7684\u5e38\u89c1\u65b9\u6cd5\uff0c\u5305\u62ecos.path\u6a21\u5757\u3001pathlib\u5e93\u7b49\uff0c\u5e76\u7ed9\u51fa\u4e86\u591a\u4e2a\u5b9e\u9645\u5e94\u7528\u7684\u793a\u4f8b\u4ee3\u7801\u3002\u540c\u65f6\uff0c\u8fd8\u4ecb\u7ecd\u4e86\u5904\u7406\u6587\u4ef6\u540e\u7f00\u540d\u65f6\u9700\u8981\u6ce8\u610f\u7684\u4e00\u4e9b\u4e8b\u9879\u3002\u5e0c\u671b\u901a\u8fc7\u672c\u6587\u7684\u4ecb\u7ecd\uff0c\u60a8\u80fd\u591f\u66f4\u597d\u5730\u7406\u89e3\u548c\u638c\u63e1Python\u4e2d\u5904\u7406\u6587\u4ef6\u540e\u7f00\u540d\u7684\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u83b7\u53d6\u6587\u4ef6\u7684\u540e\u7f00\u540d\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>os.path<\/code>\u6a21\u5757\u4e2d\u7684<code>splitext()<\/code>\u51fd\u6570\u6765\u63d0\u53d6\u6587\u4ef6\u7684\u540e\u7f00\u540d\u3002\u6b64\u51fd\u6570\u5c06\u8fd4\u56de\u4e00\u4e2a\u5305\u542b\u6587\u4ef6\u540d\u548c\u6269\u5c55\u540d\u7684\u5143\u7ec4\u3002\u4f8b\u5982\uff1a<\/p>\n<pre><code class=\"language-python\">import os\n\nfilename = &quot;example.txt&quot;\nname, extension = os.path.splitext(filename)\nprint(extension)  # \u8f93\u51fa: .txt\n<\/code><\/pre>\n<p>\u6b64\u5916\uff0c<code>pathlib<\/code>\u6a21\u5757\u4e5f\u63d0\u4f9b\u4e86\u7b80\u5355\u7684\u65b9\u6cd5\u6765\u83b7\u53d6\u540e\u7f00\u540d\uff0c\u4f7f\u7528<code>Path<\/code>\u5bf9\u8c61\u7684<code>suffix<\/code>\u5c5e\u6027\u5373\u53ef\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728Python\u4e2d\u4fdd\u5b58\u6587\u4ef6\u65f6\u81ea\u5b9a\u4e49\u540e\u7f00\u540d\uff1f<\/strong><br \/>\u5728\u4fdd\u5b58\u6587\u4ef6\u65f6\uff0c\u53ef\u4ee5\u5728\u6587\u4ef6\u540d\u4e2d\u624b\u52a8\u6dfb\u52a0\u6240\u9700\u7684\u540e\u7f00\u540d\u3002\u786e\u4fdd\u5728\u6253\u5f00\u6587\u4ef6\u65f6\u6307\u5b9a\u6b63\u786e\u7684\u6a21\u5f0f\uff0c\u4f8b\u5982\u5199\u5165\u6a21\u5f0f<code>&#39;w&#39;<\/code>\u6216\u4e8c\u8fdb\u5236\u5199\u5165\u6a21\u5f0f<code>&#39;wb&#39;<\/code>\u3002\u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"language-python\">with open(&quot;myfile.customext&quot;, &quot;w&quot;) as file:\n    file.write(&quot;\u8fd9\u662f\u4e00\u4e2a\u81ea\u5b9a\u4e49\u540e\u7f00\u540d\u7684\u6587\u4ef6\u3002&quot;)\n<\/code><\/pre>\n<p>\u5728\u6b64\u793a\u4f8b\u4e2d\uff0c\u6587\u4ef6\u5c06\u4ee5<code>.customext<\/code>\u4f5c\u4e3a\u540e\u7f00\u540d\u4fdd\u5b58\u3002<\/p>\n<p><strong>\u5982\u4f55\u68c0\u67e5\u6587\u4ef6\u540e\u7f00\u540d\u662f\u5426\u5408\u6cd5\uff1f<\/strong><br \/>\u5728\u5904\u7406\u6587\u4ef6\u65f6\uff0c\u53ef\u80fd\u9700\u8981\u786e\u4fdd\u6587\u4ef6\u7684\u540e\u7f00\u540d\u7b26\u5408\u9884\u671f\u683c\u5f0f\u3002\u53ef\u4ee5\u4f7f\u7528<code>os.path.splitext()<\/code>\u51fd\u6570\u7ed3\u5408\u6761\u4ef6\u8bed\u53e5\u6765\u9a8c\u8bc1\u6587\u4ef6\u540e\u7f00\u3002\u4ee5\u4e0b\u4ee3\u7801\u793a\u4f8b\u5c55\u793a\u4e86\u5982\u4f55\u68c0\u67e5\u540e\u7f00\u540d\uff1a<\/p>\n<pre><code class=\"language-python\">allowed_extensions = [&#39;.txt&#39;, &#39;.csv&#39;, &#39;.json&#39;]\nfilename = &quot;data.txt&quot;\n\nif os.path.splitext(filename)[1] in allowed_extensions:\n    print(&quot;\u6587\u4ef6\u540e\u7f00\u540d\u5408\u6cd5\u3002&quot;)\nelse:\n    print(&quot;\u6587\u4ef6\u540e\u7f00\u540d\u4e0d\u5408\u6cd5\u3002&quot;)\n<\/code><\/pre>\n<p>\u8fd9\u79cd\u65b9\u5f0f\u53ef\u4ee5\u5e2e\u52a9\u7528\u6237\u907f\u514d\u56e0\u9519\u8bef\u7684\u6587\u4ef6\u683c\u5f0f\u800c\u5bfc\u81f4\u7684\u95ee\u9898\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u4f7f\u7528Python\u4fdd\u5b58\u6587\u4ef6\u540e\u7f00\u540d\u7684\u5e38\u89c1\u65b9\u6cd5\u6709\uff1aos.path\u6a21\u5757\u3001pathlib\u5e93\u3001splitext()\u51fd\u6570\u7b49\u3002 [&hellip;]","protected":false},"author":3,"featured_media":1102851,"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\/1102844"}],"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=1102844"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1102844\/revisions"}],"predecessor-version":[{"id":1102853,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1102844\/revisions\/1102853"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1102851"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1102844"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1102844"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1102844"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}