{"id":1124581,"date":"2025-01-08T19:43:00","date_gmt":"2025-01-08T11:43:00","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1124581.html"},"modified":"2025-01-08T19:43:02","modified_gmt":"2025-01-08T11:43:02","slug":"python%e5%a6%82%e4%bd%95%e5%af%bc%e5%85%a5%e5%bd%93%e5%89%8d%e7%9b%ae%e5%bd%95%e4%b8%8b%e7%9a%84%e6%96%87%e4%bb%b6%e5%a4%b9","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1124581.html","title":{"rendered":"python\u5982\u4f55\u5bfc\u5165\u5f53\u524d\u76ee\u5f55\u4e0b\u7684\u6587\u4ef6\u5939"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25085550\/ddc8895e-a0c2-49c7-9aae-f6efd73292d7.webp\" alt=\"python\u5982\u4f55\u5bfc\u5165\u5f53\u524d\u76ee\u5f55\u4e0b\u7684\u6587\u4ef6\u5939\" \/><\/p>\n<p><p> <strong>\u5728Python\u4e2d\uff0c\u5bfc\u5165\u5f53\u524d\u76ee\u5f55\u4e0b\u7684\u6587\u4ef6\u5939\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u5b9e\u73b0\uff0c\u5305\u62ec\u4f7f\u7528\u76f8\u5bf9\u5bfc\u5165\u3001<code>sys.path<\/code>\u3001\u4ee5\u53ca\u7b2c\u4e09\u65b9\u5de5\u5177\u5982<code>importlib<\/code>\u3002\u6700\u5e38\u7528\u7684\u65b9\u6cd5\u5305\u62ec\uff1a\u4f7f\u7528\u76f8\u5bf9\u5bfc\u5165\u3001\u4fee\u6539<code>sys.path<\/code>\u3001\u4ee5\u53ca\u4f7f\u7528<code>importlib<\/code>\u3002\u76f8\u5bf9\u5bfc\u5165\u65b9\u6cd5\u6700\u4e3a\u76f4\u89c2\u4e14\u63a8\u8350\uff0c\u4f46\u5728\u67d0\u4e9b\u590d\u6742\u9879\u76ee\u4e2d\uff0c\u4fee\u6539<code>sys.path<\/code>\u6216\u4f7f\u7528<code>importlib<\/code>\u53ef\u80fd\u66f4\u7075\u6d3b\u3002<\/strong><\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u76f8\u5bf9\u5bfc\u5165<\/h3>\n<\/p>\n<p><p>\u76f8\u5bf9\u5bfc\u5165\u662f\u6307\u4f7f\u7528\u76f8\u5bf9\u8def\u5f84\u6765\u5bfc\u5165\u6a21\u5757\u6216\u5305\uff0c\u8fd9\u662fPython\u4e2d\u6700\u5e38\u89c1\u4e5f\u662f\u6700\u63a8\u8350\u7684\u65b9\u6cd5\u3002\u76f8\u5bf9\u5bfc\u5165\u53ef\u4ee5\u786e\u4fdd\u4ee3\u7801\u7684\u53ef\u79fb\u690d\u6027\u548c\u6a21\u5757\u5316\u7ba1\u7406\u3002<\/p>\n<\/p>\n<p><h4>\u793a\u4f8b\u4ee3\u7801\uff1a<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">from . import mymodule<\/p>\n<p>from .subpackage import mysubmodule<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u4f18\u70b9\uff1a<\/strong>  <\/p>\n<\/p>\n<ol>\n<li><strong>\u7b80\u6d01\u660e\u4e86<\/strong>\uff1a\u76f8\u5bf9\u5bfc\u5165\u8bed\u6cd5\u7b80\u5355\uff0c\u6613\u4e8e\u7406\u89e3\u3002<\/li>\n<li><strong>\u53ef\u79fb\u690d\u6027<\/strong>\uff1a\u76f8\u5bf9\u8def\u5f84\u5bfc\u5165\u786e\u4fdd\u4ee3\u7801\u53ef\u4ee5\u5728\u4e0d\u540c\u73af\u5883\u4e0b\u8fd0\u884c\uff0c\u800c\u65e0\u9700\u4fee\u6539\u8def\u5f84\u3002<\/li>\n<\/ol>\n<p><p><strong>\u8be6\u7ec6\u63cf\u8ff0\uff1a<\/strong><\/p>\n<p>\u76f8\u5bf9\u5bfc\u5165\u4f7f\u7528\u70b9\u53f7\u6765\u8868\u793a\u5c42\u7ea7\u7ed3\u6784\u3002\u4f8b\u5982\uff0c\u5355\u4e2a\u70b9\u53f7\uff08<code>.<\/code>\uff09\u8868\u793a\u5f53\u524d\u76ee\u5f55\uff0c\u4e24\u4e2a\u70b9\u53f7\uff08<code>..<\/code>\uff09\u8868\u793a\u4e0a\u4e00\u7ea7\u76ee\u5f55\u3002\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u4f60\u53ef\u4ee5\u8f7b\u677e\u5730\u5bfc\u5165\u540c\u4e00\u76ee\u5f55\u6216\u5b50\u76ee\u5f55\u4e0b\u7684\u6a21\u5757\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u4fee\u6539<code>sys.path<\/code><\/h3>\n<\/p>\n<p><p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u4f60\u53ef\u80fd\u9700\u8981\u52a8\u6001\u5730\u4fee\u6539Python\u7684\u641c\u7d22\u8def\u5f84\u3002\u8fd9\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528<code>sys.path<\/code>\u6765\u5b9e\u73b0\u3002<\/p>\n<\/p>\n<p><h4>\u793a\u4f8b\u4ee3\u7801\uff1a<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">import sys<\/p>\n<p>import os<\/p>\n<h2><strong>\u83b7\u53d6\u5f53\u524d\u76ee\u5f55<\/strong><\/h2>\n<p>current_dir = os.path.dirname(os.path.abspath(__file__))<\/p>\n<h2><strong>\u5c06\u5f53\u524d\u76ee\u5f55\u6dfb\u52a0\u5230sys.path\u4e2d<\/strong><\/h2>\n<p>sys.path.append(current_dir)<\/p>\n<p>import mymodule<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u4f18\u70b9\uff1a<\/strong>  <\/p>\n<\/p>\n<ol>\n<li><strong>\u7075\u6d3b\u6027<\/strong>\uff1a\u53ef\u4ee5\u52a8\u6001\u4fee\u6539\u8def\u5f84\uff0c\u9002\u5e94\u4e0d\u540c\u7684\u76ee\u5f55\u7ed3\u6784\u3002<\/li>\n<li><strong>\u89e3\u51b3\u590d\u6742\u9879\u76ee\u9700\u6c42<\/strong>\uff1a\u5728\u5927\u578b\u9879\u76ee\u4e2d\uff0c\u53ef\u80fd\u9700\u8981\u52a8\u6001\u5730\u5bfc\u5165\u6a21\u5757\uff0c\u6b64\u65b9\u6cd5\u975e\u5e38\u6709\u6548\u3002<\/li>\n<\/ol>\n<p><p><strong>\u8be6\u7ec6\u63cf\u8ff0\uff1a<\/strong><\/p>\n<p><code>sys.path<\/code>\u662f\u4e00\u4e2a\u5217\u8868\uff0c\u5305\u542b\u4e86Python\u89e3\u91ca\u5668\u641c\u7d22\u6a21\u5757\u7684\u8def\u5f84\u3002\u901a\u8fc7\u5728\u8fd0\u884c\u65f6\u4fee\u6539<code>sys.path<\/code>\uff0c\u4f60\u53ef\u4ee5\u52a8\u6001\u5730\u6dfb\u52a0\u6216\u5220\u9664\u641c\u7d22\u8def\u5f84\uff0c\u4ece\u800c\u5bfc\u5165\u6307\u5b9a\u76ee\u5f55\u4e0b\u7684\u6a21\u5757\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u4f7f\u7528<code>importlib<\/code><\/h3>\n<\/p>\n<p><p><code>importlib<\/code>\u662fPython\u7684\u4e00\u4e2a\u5185\u7f6e\u6a21\u5757\uff0c\u63d0\u4f9b\u4e86\u52a8\u6001\u5bfc\u5165\u6a21\u5757\u7684\u529f\u80fd\u3002\u5b83\u53ef\u4ee5\u5728\u8fd0\u884c\u65f6\u5bfc\u5165\u6a21\u5757\uff0c\u975e\u5e38\u9002\u5408\u9700\u8981\u52a8\u6001\u5bfc\u5165\u7684\u573a\u666f\u3002<\/p>\n<\/p>\n<p><h4>\u793a\u4f8b\u4ee3\u7801\uff1a<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">import importlib.util<\/p>\n<p>import sys<\/p>\n<p>import os<\/p>\n<p>def import_module_from_path(module_name, module_path):<\/p>\n<p>    spec = importlib.util.spec_from_file_location(module_name, module_path)<\/p>\n<p>    module = importlib.util.module_from_spec(spec)<\/p>\n<p>    sys.modules[module_name] = module<\/p>\n<p>    spec.loader.exec_module(module)<\/p>\n<p>    return module<\/p>\n<p>current_dir = os.path.dirname(os.path.abspath(__file__))<\/p>\n<p>module_path = os.path.join(current_dir, &#39;mymodule.py&#39;)<\/p>\n<p>mymodule = import_module_from_path(&#39;mymodule&#39;, module_path)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u4f18\u70b9\uff1a<\/strong>  <\/p>\n<\/p>\n<ol>\n<li><strong>\u5f3a\u5927\u7684\u529f\u80fd<\/strong>\uff1a<code>importlib<\/code>\u63d0\u4f9b\u4e86\u975e\u5e38\u5f3a\u5927\u7684\u52a8\u6001\u5bfc\u5165\u529f\u80fd\u3002<\/li>\n<li><strong>\u6a21\u5757\u7ba1\u7406<\/strong>\uff1a\u53ef\u4ee5\u7cbe\u7ec6\u5730\u63a7\u5236\u6a21\u5757\u7684\u52a0\u8f7d\u548c\u6267\u884c\u3002<\/li>\n<\/ol>\n<p><p><strong>\u8be6\u7ec6\u63cf\u8ff0\uff1a<\/strong><\/p>\n<p><code>importlib.util<\/code>\u63d0\u4f9b\u4e86\u591a\u4e2a\u51fd\u6570\uff0c\u7528\u4e8e\u4ece\u6587\u4ef6\u8def\u5f84\u5bfc\u5165\u6a21\u5757\u3002\u901a\u8fc7<code>spec_from_file_location<\/code>\u548c<code>module_from_spec<\/code>\u51fd\u6570\uff0c\u4f60\u53ef\u4ee5\u4ece\u6307\u5b9a\u8def\u5f84\u52a0\u8f7d\u6a21\u5757\uff0c\u5e76\u5728\u8fd0\u884c\u65f6\u6267\u884c\u8be5\u6a21\u5757\u3002\u8fd9\u79cd\u65b9\u6cd5\u975e\u5e38\u7075\u6d3b\uff0c\u9002\u7528\u4e8e\u9700\u8981\u52a8\u6001\u52a0\u8f7d\u7684\u590d\u6742\u573a\u666f\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u4f7f\u7528\u5305\u548c\u6a21\u5757<\/h3>\n<\/p>\n<p><p>\u5728Python\u4e2d\uff0c\u5305\u548c\u6a21\u5757\u662f\u7ec4\u7ec7\u4ee3\u7801\u7684\u57fa\u672c\u5355\u4f4d\u3002\u5305\u53ef\u4ee5\u5305\u542b\u591a\u4e2a\u6a21\u5757\uff0c\u6a21\u5757\u662f\u5305\u542b\u51fd\u6570\u3001\u7c7b\u548c\u53d8\u91cf\u7684\u6587\u4ef6\u3002\u901a\u8fc7\u5408\u7406\u5730\u7ec4\u7ec7\u5305\u548c\u6a21\u5757\uff0c\u53ef\u4ee5\u63d0\u9ad8\u4ee3\u7801\u7684\u53ef\u7ef4\u62a4\u6027\u548c\u53ef\u8bfb\u6027\u3002<\/p>\n<\/p>\n<p><h4>\u793a\u4f8b\u4ee3\u7801\uff1a<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\"># \u6587\u4ef6\u7ed3\u6784<\/p>\n<h2><strong>mypackage\/<\/strong><\/h2>\n<h2><strong>\u251c\u2500\u2500 __init__.py<\/strong><\/h2>\n<h2><strong>\u251c\u2500\u2500 module1.py<\/strong><\/h2>\n<h2><strong>\u2514\u2500\u2500 subpackage\/<\/strong><\/h2>\n<h2><strong>    \u251c\u2500\u2500 __init__.py<\/strong><\/h2>\n<h2><strong>    \u2514\u2500\u2500 module2.py<\/strong><\/h2>\n<h2><strong>\u5728mypackage\/__init__.py\u4e2d<\/strong><\/h2>\n<p>from .module1 import some_function<\/p>\n<h2><strong>\u5728mypackage\/subpackage\/__init__.py\u4e2d<\/strong><\/h2>\n<p>from .module2 import another_function<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u4f18\u70b9\uff1a<\/strong>  <\/p>\n<\/p>\n<ol>\n<li><strong>\u6a21\u5757\u5316\u7ba1\u7406<\/strong>\uff1a\u901a\u8fc7\u5305\u548c\u6a21\u5757\uff0c\u53ef\u4ee5\u5c06\u4ee3\u7801\u7ec4\u7ec7\u6210\u72ec\u7acb\u7684\u5355\u5143\uff0c\u65b9\u4fbf\u7ba1\u7406\u548c\u7ef4\u62a4\u3002<\/li>\n<li><strong>\u51cf\u5c11\u547d\u540d\u51b2\u7a81<\/strong>\uff1a\u5305\u548c\u6a21\u5757\u63d0\u4f9b\u4e86\u547d\u540d\u7a7a\u95f4\uff0c\u51cf\u5c11\u4e86\u547d\u540d\u51b2\u7a81\u7684\u53ef\u80fd\u6027\u3002<\/li>\n<\/ol>\n<p><p><strong>\u8be6\u7ec6\u63cf\u8ff0\uff1a<\/strong><\/p>\n<p>\u5305\u662f\u5305\u542b\u4e00\u4e2a\u7279\u6b8a\u7684<code>__init__.py<\/code>\u6587\u4ef6\u7684\u76ee\u5f55\u3002\u901a\u8fc7\u5728<code>__init__.py<\/code>\u6587\u4ef6\u4e2d\u5b9a\u4e49\u5bfc\u5165\u8bed\u53e5\uff0c\u53ef\u4ee5\u5c06\u5305\u4e2d\u7684\u6a21\u5757\u66b4\u9732\u7ed9\u5916\u90e8\u4f7f\u7528\u3002\u6a21\u5757\u662f\u5305\u542b\u51fd\u6570\u3001\u7c7b\u548c\u53d8\u91cf\u7684\u6587\u4ef6\uff0c\u53ef\u4ee5\u901a\u8fc7\u5305\u8fdb\u884c\u7ec4\u7ec7\u548c\u7ba1\u7406\u3002<\/p>\n<\/p>\n<p><h3>\u4e94\u3001\u6700\u4f73\u5b9e\u8df5\u548c\u6ce8\u610f\u4e8b\u9879<\/h3>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d\uff0c\u9009\u62e9\u9002\u5f53\u7684\u5bfc\u5165\u65b9\u6cd5\u975e\u5e38\u91cd\u8981\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u6700\u4f73\u5b9e\u8df5\u548c\u6ce8\u610f\u4e8b\u9879\uff1a<\/p>\n<\/p>\n<ol>\n<li><strong>\u4f18\u5148\u4f7f\u7528\u76f8\u5bf9\u5bfc\u5165<\/strong>\uff1a\u76f8\u5bf9\u5bfc\u5165\u7b80\u5355\u660e\u4e86\uff0c\u9002\u7528\u4e8e\u5927\u591a\u6570\u573a\u666f\u3002<\/li>\n<li><strong>\u907f\u514d\u5faa\u73af\u5bfc\u5165<\/strong>\uff1a\u5faa\u73af\u5bfc\u5165\u4f1a\u5bfc\u81f4\u5bfc\u5165\u5931\u8d25\uff0c\u5e94\u5c3d\u91cf\u907f\u514d\u3002<\/li>\n<li><strong>\u5408\u7406\u7ec4\u7ec7\u5305\u548c\u6a21\u5757<\/strong>\uff1a\u901a\u8fc7\u5408\u7406\u7684\u5305\u548c\u6a21\u5757\u7ed3\u6784\uff0c\u53ef\u4ee5\u63d0\u9ad8\u4ee3\u7801\u7684\u53ef\u7ef4\u62a4\u6027\u548c\u53ef\u8bfb\u6027\u3002<\/li>\n<li><strong>\u52a8\u6001\u5bfc\u5165\u614e\u7528<\/strong>\uff1a\u52a8\u6001\u5bfc\u5165\u529f\u80fd\u5f3a\u5927\uff0c\u4f46\u4e5f\u5e26\u6765\u4e86\u590d\u6742\u6027\uff0c\u5e94\u614e\u91cd\u4f7f\u7528\u3002<\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u4ee5\u4e0a\u65b9\u6cd5\uff0c\u4f60\u53ef\u4ee5\u7075\u6d3b\u5730\u5bfc\u5165\u5f53\u524d\u76ee\u5f55\u4e0b\u7684\u6587\u4ef6\u5939\u548c\u6a21\u5757\uff0c\u6ee1\u8db3\u4e0d\u540c\u573a\u666f\u7684\u9700\u6c42\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u5bfc\u5165\u540c\u4e00\u76ee\u5f55\u4e0b\u7684\u6a21\u5757\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>import<\/code>\u8bed\u53e5\u5bfc\u5165\u5f53\u524d\u76ee\u5f55\u4e0b\u7684\u6a21\u5757\u3002\u786e\u4fdd\u4f60\u7684Python\u811a\u672c\u548c\u8981\u5bfc\u5165\u7684\u6a21\u5757\u5728\u540c\u4e00\u4e2a\u76ee\u5f55\u4e0b\uff0c\u7136\u540e\u76f4\u63a5\u4f7f\u7528<code>import module_name<\/code>\u5373\u53ef\u5bfc\u5165\u3002\u5982\u679c\u6a21\u5757\u540d\u4e3a<code>my_module.py<\/code>\uff0c\u90a3\u4e48\u53ef\u4ee5\u901a\u8fc7<code>import my_module<\/code>\u6765\u4f7f\u7528\u5176\u4e2d\u7684\u51fd\u6570\u548c\u7c7b\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728Python\u4e2d\u5bfc\u5165\u5f53\u524d\u76ee\u5f55\u4e0b\u7684\u5b50\u6587\u4ef6\u5939\u4e2d\u7684\u6a21\u5757\uff1f<\/strong><br \/>\u8981\u5bfc\u5165\u5f53\u524d\u76ee\u5f55\u4e0b\u5b50\u6587\u4ef6\u5939\u4e2d\u7684\u6a21\u5757\uff0c\u9996\u5148\u9700\u8981\u786e\u4fdd\u5b50\u6587\u4ef6\u5939\u4e2d\u6709\u4e00\u4e2a<code>__init__.py<\/code>\u6587\u4ef6\uff08\u5373\u4f7f\u662f\u7a7a\u6587\u4ef6\u4e5f\u53ef\u4ee5\uff09\uff0c\u8fd9\u4f7f\u5f97\u8be5\u6587\u4ef6\u5939\u88ab\u89c6\u4e3a\u4e00\u4e2a\u5305\u3002\u7136\u540e\u4f7f\u7528<code>from folder_name import module_name<\/code>\u8bed\u53e5\u6765\u5bfc\u5165\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4f60\u6709\u4e00\u4e2a\u540d\u4e3a<code>my_folder<\/code>\u7684\u6587\u4ef6\u5939\uff0c\u91cc\u9762\u6709\u4e00\u4e2a<code>my_module.py<\/code>\uff0c\u53ef\u4ee5\u4f7f\u7528<code>from my_folder import my_module<\/code>\u6765\u5bfc\u5165\u3002<\/p>\n<p><strong>\u5728Python\u4e2d\u5982\u4f55\u5904\u7406\u5bfc\u5165\u9519\u8bef\uff1f<\/strong><br \/>\u5bfc\u5165\u9519\u8bef\u901a\u5e38\u53d1\u751f\u5728\u6a21\u5757\u4e0d\u5b58\u5728\u6216\u8def\u5f84\u4e0d\u6b63\u786e\u65f6\u3002\u68c0\u67e5\u6a21\u5757\u540d\u662f\u5426\u62fc\u5199\u6b63\u786e\uff0c\u5e76\u786e\u4fdd\u5b83\u4eec\u4f4d\u4e8ePython\u7684\u641c\u7d22\u8def\u5f84\u4e2d\u3002\u5982\u679c\u5728\u540c\u4e00\u76ee\u5f55\u4e0b\u4ecd\u7136\u65e0\u6cd5\u5bfc\u5165\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u6253\u5370<code>sys.path<\/code>\u6765\u67e5\u770bPython\u7684\u6a21\u5757\u641c\u7d22\u8def\u5f84\uff0c\u5e76\u786e\u4fdd\u5f53\u524d\u76ee\u5f55\u5728\u5176\u4e2d\u3002\u5982\u679c\u9700\u8981\u6dfb\u52a0\u5f53\u524d\u76ee\u5f55\uff0c\u53ef\u4ee5\u5728\u4ee3\u7801\u4e2d\u4f7f\u7528<code>import sys; sys.path.append(&#39;.&#39;)<\/code>\u6765\u624b\u52a8\u6dfb\u52a0\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\uff0c\u5bfc\u5165\u5f53\u524d\u76ee\u5f55\u4e0b\u7684\u6587\u4ef6\u5939\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u5b9e\u73b0\uff0c\u5305\u62ec\u4f7f\u7528\u76f8\u5bf9\u5bfc\u5165\u3001sys.path\u3001\u4ee5\u53ca\u7b2c\u4e09\u65b9\u5de5 [&hellip;]","protected":false},"author":3,"featured_media":1124594,"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\/1124581"}],"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=1124581"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1124581\/revisions"}],"predecessor-version":[{"id":1124596,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1124581\/revisions\/1124596"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1124594"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1124581"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1124581"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1124581"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}