{"id":1097276,"date":"2025-01-08T15:10:10","date_gmt":"2025-01-08T07:10:10","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1097276.html"},"modified":"2025-01-08T15:10:13","modified_gmt":"2025-01-08T07:10:13","slug":"python%e5%a6%82%e4%bd%95%e4%b8%a4%e4%b8%aapy%e6%96%87%e4%bb%b6%e8%b0%83%e7%94%a8-3","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1097276.html","title":{"rendered":"python\u5982\u4f55\u4e24\u4e2apy\u6587\u4ef6\u8c03\u7528"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/24212116\/e6bfd690-fa72-47d5-aaf4-34111a332033.webp\" alt=\"python\u5982\u4f55\u4e24\u4e2apy\u6587\u4ef6\u8c03\u7528\" \/><\/p>\n<p><p> <strong>\u4f7f\u7528<code>import<\/code>\u3001\u4f7f\u7528<code>from ... import ...<\/code>\u3001\u4f7f\u7528<code>import ... as ...<\/code><\/strong>\u3002\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u8fd9\u4e09\u79cd\u65b9\u5f0f\u6765\u8c03\u7528\u53e6\u4e00\u4e2a\u6587\u4ef6\u4e2d\u7684\u51fd\u6570\u3001\u7c7b\u6216\u53d8\u91cf\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5176\u4e2d\u4e00\u79cd\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><p><strong>\u4f7f\u7528<code>import<\/code>\uff1a\u8fd9\u662f\u6700\u5e38\u7528\u7684\u65b9\u5f0f\u4e4b\u4e00\u3002\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u53ef\u4ee5\u5c06\u53e6\u4e00\u4e2a\u6587\u4ef6\u4e2d\u7684\u6240\u6709\u51fd\u6570\u3001\u7c7b\u548c\u53d8\u91cf\u5bfc\u5165\u5230\u5f53\u524d\u6587\u4ef6\u4e2d\u3002<\/strong><\/p>\n<\/p>\n<p><p>\u5047\u8bbe\u6709\u4e24\u4e2aPython\u6587\u4ef6\uff0c\u5206\u522b\u662f<code>file1.py<\/code>\u548c<code>file2.py<\/code>\uff0c\u5176\u4e2d<code>file1.py<\/code>\u5305\u542b\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># file1.py<\/p>\n<p>def greet():<\/p>\n<p>    return &quot;Hello from file1!&quot;<\/p>\n<p>def add(a, b):<\/p>\n<p>    return a + b<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8981\u5728<code>file2.py<\/code>\u4e2d\u8c03\u7528<code>file1.py<\/code>\u4e2d\u7684\u51fd\u6570\uff0c\u53ef\u4ee5\u4f7f\u7528<code>import<\/code>\u8bed\u53e5\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># file2.py<\/p>\n<p>import file1<\/p>\n<p>print(file1.greet())  # \u8f93\u51fa: Hello from file1!<\/p>\n<p>print(file1.add(5, 3))  # \u8f93\u51fa: 8<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u8c03\u7528<code>file1.py<\/code>\u4e2d\u7684\u6240\u6709\u51fd\u6570\u3002\u63a5\u4e0b\u6765\uff0c\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528\u8fd9\u79cd\u65b9\u5f0f\uff0c\u5e76\u63a2\u8ba8Python\u4e2d\u6a21\u5757\u548c\u5305\u7684\u66f4\u591a\u5185\u5bb9\u3002<\/p>\n<\/p>\n<h2><strong>\u4e00\u3001\u4f7f\u7528import<\/strong><\/h2>\n<p><h3>1.1 \u76f4\u63a5\u5bfc\u5165\u6574\u4e2a\u6a21\u5757<\/h3>\n<\/p>\n<p><p>\u4f7f\u7528<code>import<\/code>\u8bed\u53e5\u53ef\u4ee5\u76f4\u63a5\u5bfc\u5165\u6574\u4e2a\u6a21\u5757\u3002\u8fd9\u79cd\u65b9\u5f0f\u5bfc\u5165\u7684\u6a21\u5757\u9700\u8981\u901a\u8fc7\u6a21\u5757\u540d\u6765\u8bbf\u95ee\u5176\u5185\u90e8\u7684\u51fd\u6570\u3001\u7c7b\u6216\u53d8\u91cf\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import file1<\/p>\n<p>print(file1.greet())  # \u8f93\u51fa: Hello from file1!<\/p>\n<p>print(file1.add(5, 3))  # \u8f93\u51fa: 8<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u79cd\u65b9\u5f0f\u7684\u4f18\u70b9\u662f\u4ee3\u7801\u7ed3\u6784\u6e05\u6670\uff0c\u6a21\u5757\u540d\u663e\u5f0f\u5730\u544a\u8bc9\u6211\u4eec\u8fd9\u4e9b\u51fd\u6570\u6765\u81ea\u54ea\u91cc\u3002<\/p>\n<\/p>\n<p><h3>1.2 \u5bfc\u5165\u6a21\u5757\u5e76\u4f7f\u7528\u522b\u540d<\/h3>\n<\/p>\n<p><p>\u4e3a\u4e86\u7b80\u5316\u4ee3\u7801\uff0c\u6709\u65f6\u53ef\u4ee5\u7ed9\u6a21\u5757\u8d77\u4e00\u4e2a\u522b\u540d\uff0c\u8fd9\u6837\u5728\u8c03\u7528\u6a21\u5757\u4e2d\u7684\u51fd\u6570\u65f6\u5c31\u4e0d\u9700\u8981\u6bcf\u6b21\u90fd\u5199\u5b8c\u6574\u7684\u6a21\u5757\u540d\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import file1 as f1<\/p>\n<p>print(f1.greet())  # \u8f93\u51fa: Hello from file1!<\/p>\n<p>print(f1.add(5, 3))  # \u8f93\u51fa: 8<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u79cd\u65b9\u5f0f\u7684\u4f18\u70b9\u662f\u4ee3\u7801\u66f4\u7b80\u6d01\uff0c\u4f46\u4ecd\u7136\u4fdd\u6301\u4e86\u6a21\u5757\u540d\u7684\u53ef\u8bfb\u6027\u3002<\/p>\n<\/p>\n<h2><strong>\u4e8c\u3001\u4f7f\u7528from &#8230; import &#8230;<\/strong><\/h2>\n<p><h3>2.1 \u5bfc\u5165\u6a21\u5757\u4e2d\u7684\u7279\u5b9a\u51fd\u6570\u3001\u7c7b\u6216\u53d8\u91cf<\/h3>\n<\/p>\n<p><p>\u6709\u65f6\u6211\u4eec\u53ea\u9700\u8981\u4f7f\u7528\u6a21\u5757\u4e2d\u7684\u67d0\u51e0\u4e2a\u51fd\u6570\u3001\u7c7b\u6216\u53d8\u91cf\uff0c\u8fd9\u65f6\u53ef\u4ee5\u4f7f\u7528<code>from ... import ...<\/code>\u8bed\u53e5\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from file1 import greet, add<\/p>\n<p>print(greet())  # \u8f93\u51fa: Hello from file1!<\/p>\n<p>print(add(5, 3))  # \u8f93\u51fa: 8<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u79cd\u65b9\u5f0f\u7684\u4f18\u70b9\u662f\u4ee3\u7801\u66f4\u7b80\u6d01\uff0c\u5e76\u4e14\u53ea\u5bfc\u5165\u6240\u9700\u7684\u90e8\u5206\uff0c\u51cf\u5c11\u4e86\u547d\u540d\u51b2\u7a81\u7684\u53ef\u80fd\u6027\u3002<\/p>\n<\/p>\n<p><h3>2.2 \u5bfc\u5165\u6a21\u5757\u4e2d\u7684\u6240\u6709\u5185\u5bb9<\/h3>\n<\/p>\n<p><p>\u5982\u679c\u9700\u8981\u5bfc\u5165\u6a21\u5757\u4e2d\u7684\u6240\u6709\u5185\u5bb9\uff0c\u53ef\u4ee5\u4f7f\u7528<code>from ... import *<\/code>\u8bed\u53e5\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from file1 import *<\/p>\n<p>print(greet())  # \u8f93\u51fa: Hello from file1!<\/p>\n<p>print(add(5, 3))  # \u8f93\u51fa: 8<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u79cd\u65b9\u5f0f\u7684\u4f18\u70b9\u662f\u4ee3\u7801\u7b80\u6d01\uff0c\u4f46\u7f3a\u70b9\u662f\u53ef\u80fd\u4f1a\u5f15\u5165\u547d\u540d\u51b2\u7a81\uff0c\u5c24\u5176\u662f\u5728\u5927\u578b\u9879\u76ee\u4e2d\u3002<\/p>\n<\/p>\n<h2><strong>\u4e09\u3001\u4f7f\u7528import &#8230; as &#8230;<\/strong><\/h2>\n<p><h3>3.1 \u7ed9\u6a21\u5757\u4e2d\u7684\u51fd\u6570\u3001\u7c7b\u6216\u53d8\u91cf\u8d77\u522b\u540d<\/h3>\n<\/p>\n<p><p>\u6709\u65f6\u6a21\u5757\u4e2d\u7684\u51fd\u6570\u3001\u7c7b\u6216\u53d8\u91cf\u540d\u592a\u957f\uff0c\u6216\u8005\u4e0e\u5f53\u524d\u6587\u4ef6\u4e2d\u7684\u5176\u4ed6\u540d\u79f0\u51b2\u7a81\uff0c\u8fd9\u65f6\u53ef\u4ee5\u4f7f\u7528<code>import ... as ...<\/code>\u8bed\u53e5\u7ed9\u5b83\u4eec\u8d77\u522b\u540d\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from file1 import greet as g, add as a<\/p>\n<p>print(g())  # \u8f93\u51fa: Hello from file1!<\/p>\n<p>print(a(5, 3))  # \u8f93\u51fa: 8<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u79cd\u65b9\u5f0f\u7684\u4f18\u70b9\u662f\u4ee3\u7801\u66f4\u7b80\u6d01\uff0c\u5e76\u4e14\u53ef\u4ee5\u907f\u514d\u547d\u540d\u51b2\u7a81\u3002<\/p>\n<\/p>\n<h2><strong>\u56db\u3001\u6a21\u5757\u548c\u5305<\/strong><\/h2>\n<p><h3>4.1 \u6a21\u5757<\/h3>\n<\/p>\n<p><p>\u5728Python\u4e2d\uff0c\u6bcf\u4e2a\u4ee5<code>.py<\/code>\u7ed3\u5c3e\u7684\u6587\u4ef6\u90fd\u662f\u4e00\u4e2a\u6a21\u5757\u3002\u6a21\u5757\u53ef\u4ee5\u5305\u542b\u51fd\u6570\u3001\u7c7b\u548c\u53d8\u91cf\uff0c\u4ee5\u53ca\u53ef\u6267\u884c\u7684\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><h3>4.2 \u5305<\/h3>\n<\/p>\n<p><p>\u5305\u662f\u5305\u542b\u6a21\u5757\u7684\u6587\u4ef6\u5939\u3002\u5305\u901a\u8fc7\u4e00\u4e2a\u7279\u6b8a\u7684\u6587\u4ef6<code>__init__.py<\/code>\u6765\u533a\u5206\u666e\u901a\u6587\u4ef6\u5939\u548c\u5305\u3002\u8fd9\u4e2a\u6587\u4ef6\u53ef\u4ee5\u662f\u7a7a\u7684\uff0c\u4e5f\u53ef\u4ee5\u5305\u542b\u5305\u7684\u521d\u59cb\u5316\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><p>\u5047\u8bbe\u6709\u4e00\u4e2a\u5305\u7ed3\u6784\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><pre><code>mypackage\/<\/p>\n<p>    __init__.py<\/p>\n<p>    module1.py<\/p>\n<p>    module2.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u53ef\u4ee5\u4f7f\u7528<code>import<\/code>\u8bed\u53e5\u5bfc\u5165\u5305\u4e2d\u7684\u6a21\u5757\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from mypackage import module1, module2<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u6216\u8005\u5bfc\u5165\u5305\u4e2d\u7684\u7279\u5b9a\u51fd\u6570\u3001\u7c7b\u6216\u53d8\u91cf\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from mypackage.module1 import func1<\/p>\n<p>from mypackage.module2 import Class1<\/p>\n<p><\/code><\/pre>\n<\/p>\n<h2><strong>\u4e94\u3001\u793a\u4f8b\u9879\u76ee<\/strong><\/h2>\n<p><p>\u4e0b\u9762\u662f\u4e00\u4e2a\u5b8c\u6574\u7684\u793a\u4f8b\u9879\u76ee\uff0c\u5c55\u793a\u4e86\u5982\u4f55\u5728\u5b9e\u9645\u9879\u76ee\u4e2d\u4f7f\u7528\u6a21\u5757\u548c\u5305\u3002<\/p>\n<\/p>\n<p><p>\u5047\u8bbe\u6709\u4e00\u4e2a\u9879\u76ee\u7ed3\u6784\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><pre><code>myproject\/<\/p>\n<p>    __init__.py<\/p>\n<p>    m<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>n.py<\/p>\n<p>    utils\/<\/p>\n<p>        __init__.py<\/p>\n<p>        math_utils.py<\/p>\n<p>        string_utils.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5176\u4e2d<code>math_utils.py<\/code>\u5305\u542b\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># math_utils.py<\/p>\n<p>def add(a, b):<\/p>\n<p>    return a + b<\/p>\n<p>def subtract(a, b):<\/p>\n<p>    return a - b<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><code>string_utils.py<\/code>\u5305\u542b\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># string_utils.py<\/p>\n<p>def to_upper(s):<\/p>\n<p>    return s.upper()<\/p>\n<p>def to_lower(s):<\/p>\n<p>    return s.lower()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><code>main.py<\/code>\u5305\u542b\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># main.py<\/p>\n<p>from utils.math_utils import add, subtract<\/p>\n<p>from utils.string_utils import to_upper, to_lower<\/p>\n<p>print(add(5, 3))  # \u8f93\u51fa: 8<\/p>\n<p>print(subtract(5, 3))  # \u8f93\u51fa: 2<\/p>\n<p>print(to_upper(&quot;hello&quot;))  # \u8f93\u51fa: HELLO<\/p>\n<p>print(to_lower(&quot;WORLD&quot;))  # \u8f93\u51fa: world<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u53ef\u4ee5\u5728\u9879\u76ee\u4e2d\u7ec4\u7ec7\u548c\u8c03\u7528\u4e0d\u540c\u6a21\u5757\u548c\u5305\u4e2d\u7684\u51fd\u6570\u3001\u7c7b\u548c\u53d8\u91cf\uff0c\u4ece\u800c\u4f7f\u4ee3\u7801\u7ed3\u6784\u6e05\u6670\u4e14\u6613\u4e8e\u7ef4\u62a4\u3002<\/p>\n<\/p>\n<h2><strong>\u603b\u7ed3<\/strong><\/h2>\n<p><p>\u901a\u8fc7\u672c\u6587\u7684\u4ecb\u7ecd\uff0c\u6211\u4eec\u8be6\u7ec6\u63a2\u8ba8\u4e86\u5728Python\u4e2d\u5982\u4f55\u8c03\u7528\u53e6\u4e00\u4e2a\u6587\u4ef6\u4e2d\u7684\u51fd\u6570\u3001\u7c7b\u6216\u53d8\u91cf\uff0c\u5305\u62ec\u4f7f\u7528<code>import<\/code>\u3001<code>from ... import ...<\/code>\u3001<code>import ... as ...<\/code>\u7b49\u65b9\u5f0f\u3002\u540c\u65f6\u4ecb\u7ecd\u4e86\u6a21\u5757\u548c\u5305\u7684\u6982\u5ff5\uff0c\u4ee5\u53ca\u5982\u4f55\u5728\u5b9e\u9645\u9879\u76ee\u4e2d\u7ec4\u7ec7\u548c\u8c03\u7528\u5b83\u4eec\u3002\u5e0c\u671b\u901a\u8fc7\u8fd9\u4e9b\u5185\u5bb9\uff0c\u60a8\u80fd\u591f\u66f4\u597d\u5730\u7406\u89e3\u548c\u638c\u63e1Python\u4e2d\u7684\u6a21\u5757\u548c\u5305\u7684\u4f7f\u7528\uff0c\u4ece\u800c\u7f16\u5199\u51fa\u66f4\u6e05\u6670\u3001\u6613\u7ef4\u62a4\u7684\u4ee3\u7801\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728\u4e00\u4e2aPython\u6587\u4ef6\u4e2d\u8c03\u7528\u53e6\u4e00\u4e2aPython\u6587\u4ef6\u7684\u51fd\u6570\uff1f<\/strong><br \/>\u8981\u5728\u4e00\u4e2aPython\u6587\u4ef6\u4e2d\u8c03\u7528\u53e6\u4e00\u4e2aPython\u6587\u4ef6\u7684\u51fd\u6570\uff0c\u60a8\u9700\u8981\u4f7f\u7528<code>import<\/code>\u8bed\u53e5\u3002\u9996\u5148\u786e\u4fdd\u4e24\u4e2a\u6587\u4ef6\u5728\u540c\u4e00\u76ee\u5f55\u4e0b\uff0c\u6216\u8005\u5728Python\u8def\u5f84\u4e2d\u53ef\u627e\u5230\u3002\u7136\u540e\u5728\u7b2c\u4e00\u4e2a\u6587\u4ef6\u4e2d\uff0c\u901a\u8fc7<code>import filename<\/code>\u5bfc\u5165\u7b2c\u4e8c\u4e2a\u6587\u4ef6\uff0c\u63a5\u7740\u53ef\u4ee5\u76f4\u63a5\u8c03\u7528\u5176\u4e2d\u5b9a\u4e49\u7684\u51fd\u6570\u3002\u4f8b\u5982\uff0c\u5982\u679c\u60a8\u6709\u4e00\u4e2a\u540d\u4e3a<code>file1.py<\/code>\u7684\u6587\u4ef6\uff0c\u91cc\u9762\u5b9a\u4e49\u4e86\u4e00\u4e2a\u51fd\u6570<code>my_function()<\/code>\uff0c\u60a8\u53ef\u4ee5\u5728<code>file2.py<\/code>\u4e2d\u4f7f\u7528<code>from file1 import my_function<\/code>\u6765\u8c03\u7528\u5b83\u3002<\/p>\n<p><strong>\u5982\u4f55\u5904\u7406\u4e24\u4e2aPython\u6587\u4ef6\u4e4b\u95f4\u7684\u53d8\u91cf\u5171\u4eab\uff1f<\/strong><br \/>\u8981\u5728\u4e24\u4e2aPython\u6587\u4ef6\u4e4b\u95f4\u5171\u4eab\u53d8\u91cf\uff0c\u60a8\u53ef\u4ee5\u5c06\u8fd9\u4e9b\u53d8\u91cf\u653e\u5728\u4e00\u4e2a\u5355\u72ec\u7684\u6587\u4ef6\u4e2d\uff0c\u5e76\u901a\u8fc7<code>import<\/code>\u8bed\u53e5\u5bfc\u5165\u3002\u4f8b\u5982\uff0c\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>config.py<\/code>\u7684\u6587\u4ef6\uff0c\u5b9a\u4e49\u5171\u4eab\u53d8\u91cf\u3002\u5176\u4ed6\u6587\u4ef6\u901a\u8fc7<code>import config<\/code>\u6765\u8bbf\u95ee\u8fd9\u4e9b\u53d8\u91cf\u3002\u786e\u4fdd\u5728\u4f7f\u7528\u65f6\u4f7f\u7528<code>config.variable_name<\/code>\u7684\u65b9\u5f0f\u6765\u5f15\u7528\u8fd9\u4e9b\u5171\u4eab\u53d8\u91cf\uff0c\u4ee5\u907f\u514d\u547d\u540d\u51b2\u7a81\u3002<\/p>\n<p><strong>\u5728\u4e24\u4e2aPython\u6587\u4ef6\u95f4\u8c03\u7528\u65f6\uff0c\u5982\u4f55\u5904\u7406\u5faa\u73af\u5f15\u7528\u95ee\u9898\uff1f<\/strong><br \/>\u5faa\u73af\u5f15\u7528\u901a\u5e38\u53d1\u751f\u5728\u4e24\u4e2a\u6587\u4ef6\u76f8\u4e92\u5bfc\u5165\u7684\u60c5\u51b5\u4e0b\uff0c\u5bfc\u81f4\u9519\u8bef\u3002\u4e3a\u907f\u514d\u8fd9\u79cd\u60c5\u51b5\uff0c\u53ef\u4ee5\u8003\u8651\u91cd\u6784\u4ee3\u7801\uff0c\u5c06\u5171\u4eab\u7684\u529f\u80fd\u6216\u53d8\u91cf\u653e\u5165\u4e00\u4e2a\u7b2c\u4e09\u4e2a\u6587\u4ef6\u4e2d\uff0c\u7136\u540e\u8ba9\u5176\u4ed6\u4e24\u4e2a\u6587\u4ef6\u53ea\u5bfc\u5165\u8fd9\u4e2a\u7b2c\u4e09\u4e2a\u6587\u4ef6\u3002\u8fd9\u6837\u53ef\u4ee5\u6709\u6548\u5730\u6253\u7834\u5faa\u73af\u4f9d\u8d56\uff0c\u786e\u4fdd\u4ee3\u7801\u7684\u6e05\u6670\u6027\u548c\u53ef\u7ef4\u62a4\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u4f7f\u7528import\u3001\u4f7f\u7528from &#8230; import &#8230;\u3001\u4f7f\u7528import &#8230; as &#8230;\u3002\u5728Pyt [&hellip;]","protected":false},"author":3,"featured_media":1097282,"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\/1097276"}],"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=1097276"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1097276\/revisions"}],"predecessor-version":[{"id":1097284,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1097276\/revisions\/1097284"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1097282"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1097276"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1097276"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1097276"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}