{"id":962790,"date":"2024-12-27T04:11:35","date_gmt":"2024-12-26T20:11:35","guid":{"rendered":""},"modified":"2024-12-27T04:11:37","modified_gmt":"2024-12-26T20:11:37","slug":"python%e5%a6%82%e4%bd%95%e8%b0%83%e7%94%a8c%e7%a8%8b%e5%ba%8f","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/962790.html","title":{"rendered":"python\u5982\u4f55\u8c03\u7528c\u7a0b\u5e8f"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25104650\/66a4bb99-1910-4f22-89a6-57edbe19a385.webp\" alt=\"python\u5982\u4f55\u8c03\u7528c\u7a0b\u5e8f\" \/><\/p>\n<p><p> <strong>Python\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u51e0\u79cd\u65b9\u5f0f\u8c03\u7528C\u7a0b\u5e8f\uff1a\u4f7f\u7528ctypes\u5e93\u3001\u4f7f\u7528Cython\u3001\u901a\u8fc7subprocess\u6a21\u5757\u8c03\u7528\u5916\u90e8C\u7a0b\u5e8f\u3001\u4f7f\u7528SWIG\u5de5\u5177\u3002\u5176\u4e2d\uff0c\u4f7f\u7528ctypes\u5e93\u662f\u8f83\u4e3a\u7b80\u5355\u4e14\u76f4\u63a5\u7684\u65b9\u6cd5\u3002<\/strong><\/p>\n<\/p>\n<p><p>Python\u662f\u4e00\u79cd\u9ad8\u7ea7\u7f16\u7a0b\u8bed\u8a00\uff0c\u56e0\u5176\u7b80\u6d01\u6613\u7528\u800c\u88ab\u5e7f\u6cdb\u4f7f\u7528\u3002\u7136\u800c\uff0c\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0cC\u7a0b\u5e8f\u53ef\u80fd\u4f1a\u56e0\u4e3a\u901f\u5ea6\u6216\u73b0\u6709\u7684\u4ee3\u7801\u5e93\u800c\u6210\u4e3a\u9996\u9009\u3002\u5c06Python\u4e0eC\u7ed3\u5408\u53ef\u4ee5\u5145\u5206\u5229\u7528\u4e24\u8005\u7684\u4f18\u52bf\u3002\u4ee5\u4e0b\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u6bcf\u79cd\u65b9\u6cd5\u7684\u5b9e\u73b0\u548c\u9002\u7528\u573a\u666f\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u4f7f\u7528CTYPES\u5e93<\/p>\n<\/p>\n<p><p><code>ctypes<\/code>\u662fPython\u7684\u4e00\u4e2a\u5916\u90e8\u51fd\u6570\u5e93\uff0c\u5b83\u5141\u8bb8Python\u8c03\u7528C\u51fd\u6570\u4ee5\u53ca\u4f7f\u7528C\u6570\u636e\u7c7b\u578b\u3002\u4f7f\u7528<code>ctypes<\/code>\u53ef\u4ee5\u76f4\u63a5\u52a0\u8f7dC\u52a8\u6001\u94fe\u63a5\u5e93\uff08DLL\u6216.so\u6587\u4ef6\uff09\uff0c\u4ece\u800c\u5b9e\u73b0\u5bf9C\u4ee3\u7801\u7684\u8c03\u7528\u3002<\/p>\n<\/p>\n<p><h3>1.1 \u52a0\u8f7dC\u52a8\u6001\u5e93<\/h3>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u9700\u8981\u7f16\u5199\u4e00\u4e2a\u7b80\u5355\u7684C\u7a0b\u5e8f\u5e76\u7f16\u8bd1\u6210\u52a8\u6001\u5e93\u3002\u4f8b\u5982\uff0c\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>example.c<\/code>\u7684\u6587\u4ef6\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-c\">#include &lt;stdio.h&gt;<\/p>\n<p>void hello() {<\/p>\n<p>    printf(&quot;Hello from C!\\n&quot;);<\/p>\n<p>}<\/p>\n<p>int add(int a, int b) {<\/p>\n<p>    return a + b;<\/p>\n<p>}<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u7136\u540e\uff0c\u7f16\u8bd1\u8be5C\u6587\u4ef6\u4e3a\u5171\u4eab\u5e93\uff08\u5728Linux\u4e0a\u4e3a.so\u6587\u4ef6\uff0c\u5728Windows\u4e0a\u4e3a.dll\u6587\u4ef6\uff09\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">gcc -shared -o example.so -fPIC example.c<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>1.2 \u4f7f\u7528CTYPES\u8c03\u7528C\u51fd\u6570<\/h3>\n<\/p>\n<p><p>\u5728Python\u4e2d\u4f7f\u7528<code>ctypes<\/code>\u52a0\u8f7d\u8be5\u5171\u4eab\u5e93\u5e76\u8c03\u7528\u5176\u51fd\u6570\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import ctypes<\/p>\n<h2><strong>\u52a0\u8f7d\u5171\u4eab\u5e93<\/strong><\/h2>\n<p>lib = ctypes.CDLL(&#39;.\/example.so&#39;)<\/p>\n<h2><strong>\u8c03\u7528hello\u51fd\u6570<\/strong><\/h2>\n<p>lib.hello()<\/p>\n<h2><strong>\u8c03\u7528add\u51fd\u6570<\/strong><\/h2>\n<p>result = lib.add(5, 3)<\/p>\n<p>print(f&quot;The result of add is: {result}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7<code>ctypes<\/code>\uff0c\u6211\u4eec\u53ef\u4ee5\u8f7b\u677e\u8c03\u7528C\u51fd\u6570\uff0c\u5e76\u5904\u7406C\u8bed\u8a00\u7684\u6570\u636e\u7c7b\u578b\u3002\u5bf9\u4e8e\u9700\u8981\u9ad8\u6027\u80fd\u8ba1\u7b97\u7684\u573a\u666f\uff0c<code>ctypes<\/code>\u63d0\u4f9b\u4e86\u4e00\u79cd\u7b80\u5355\u800c\u6709\u6548\u7684\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u4f7f\u7528CYTHON<\/p>\n<\/p>\n<p><p>Cython\u662f\u4e00\u79cd\u8d85\u96c6\u7684Python\u8bed\u8a00\uff0c\u5b83\u5141\u8bb8\u5c06Python\u4ee3\u7801\u7f16\u8bd1\u4e3aC\u4ee3\u7801\uff0c\u4ece\u800c\u63d0\u9ad8\u7a0b\u5e8f\u7684\u6267\u884c\u901f\u5ea6\u3002\u4f7f\u7528Cython\u53ef\u4ee5\u8f7b\u677e\u8c03\u7528C\u51fd\u6570\uff0c\u5e76\u5728Python\u4e2d\u4f7f\u7528C\u8bed\u8a00\u7684\u6570\u636e\u7c7b\u578b\u3002<\/p>\n<\/p>\n<p><h3>2.1 \u7f16\u5199Cython\u4ee3\u7801<\/h3>\n<\/p>\n<p><p>\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>example.pyx<\/code>\u7684Cython\u6587\u4ef6\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-cython\">cdef extern from &quot;example.h&quot;:<\/p>\n<p>    void hello()<\/p>\n<p>    int add(int a, int b)<\/p>\n<p>def py_hello():<\/p>\n<p>    hello()<\/p>\n<p>def py_add(int a, int b):<\/p>\n<p>    return add(a, b)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>2.2 \u7f16\u8bd1Cython\u4ee3\u7801<\/h3>\n<\/p>\n<p><p>\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>setup.py<\/code>\u7684\u6587\u4ef6\u7528\u4e8e\u7f16\u8bd1Cython\u4ee3\u7801\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from setuptools import setup<\/p>\n<p>from Cython.Build import cythonize<\/p>\n<p>setup(<\/p>\n<p>    ext_modules=cythonize(&quot;example.pyx&quot;),<\/p>\n<p>)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u7136\u540e\uff0c\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u7f16\u8bd1Cython\u4ee3\u7801\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">python setup.py build_ext --inplace<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>2.3 \u8c03\u7528Cython\u51fd\u6570<\/h3>\n<\/p>\n<p><p>\u7f16\u8bd1\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u5728Python\u4e2d\u8c03\u7528Cython\u7f16\u5199\u7684\u51fd\u6570\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import example<\/p>\n<p>example.py_hello()<\/p>\n<p>result = example.py_add(5, 3)<\/p>\n<p>print(f&quot;The result of add is: {result}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>Cython\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u5de5\u5177\uff0c\u5c24\u5176\u9002\u7528\u4e8e\u9700\u8981\u5728Python\u4e2d\u8c03\u7528\u5927\u91cfC\u4ee3\u7801\u7684\u573a\u666f\u3002\u901a\u8fc7\u5c06Python\u4ee3\u7801\u7f16\u8bd1\u4e3aC\u4ee3\u7801\uff0cCython\u80fd\u591f\u663e\u8457\u63d0\u9ad8\u7a0b\u5e8f\u7684\u6267\u884c\u901f\u5ea6\u3002<\/p>\n<\/p>\n<p><p>\u4e09\u3001\u901a\u8fc7SUBPROCESS\u6a21\u5757\u8c03\u7528\u5916\u90e8C\u7a0b\u5e8f<\/p>\n<\/p>\n<p><p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0cC\u7a0b\u5e8f\u53ef\u80fd\u5df2\u7ecf\u5b58\u5728\u4e3a\u53ef\u6267\u884c\u6587\u4ef6\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u53ef\u4ee5\u4f7f\u7528Python\u7684<code>subprocess<\/code>\u6a21\u5757\u6765\u8c03\u7528\u5916\u90e8C\u7a0b\u5e8f\u3002<\/p>\n<\/p>\n<p><h3>3.1 \u7f16\u5199C\u7a0b\u5e8f<\/h3>\n<\/p>\n<p><p>\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>example.c<\/code>\u7684C\u6587\u4ef6\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-c\">#include &lt;stdio.h&gt;<\/p>\n<p>int m<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>n() {<\/p>\n<p>    printf(&quot;Hello from C program!\\n&quot;);<\/p>\n<p>    return 0;<\/p>\n<p>}<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u7f16\u8bd1\u8be5C\u6587\u4ef6\u4e3a\u53ef\u6267\u884c\u6587\u4ef6\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">gcc -o example example.c<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>3.2 \u4f7f\u7528SUBPROCESS\u8c03\u7528C\u7a0b\u5e8f<\/h3>\n<\/p>\n<p><p>\u5728Python\u4e2d\u4f7f\u7528<code>subprocess<\/code>\u6a21\u5757\u8c03\u7528\u8be5\u53ef\u6267\u884c\u6587\u4ef6\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import subprocess<\/p>\n<p>result = subprocess.run([&#39;.\/example&#39;], capture_output=True, text=True)<\/p>\n<p>print(result.stdout)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7<code>subprocess<\/code>\u6a21\u5757\uff0c\u53ef\u4ee5\u8c03\u7528\u4efb\u4f55\u5916\u90e8\u7a0b\u5e8f\uff0c\u5e76\u83b7\u53d6\u5176\u8f93\u51fa\u3002\u8fd9\u5bf9\u4e8e\u9700\u8981\u96c6\u6210\u73b0\u6709C\u7a0b\u5e8f\u7684\u573a\u666f\u975e\u5e38\u6709\u7528\u3002<\/p>\n<\/p>\n<p><p>\u56db\u3001\u4f7f\u7528SWIG\u5de5\u5177<\/p>\n<\/p>\n<p><p>SWIG\uff08Simplified Wrapper and Interface Generator\uff09\u662f\u4e00\u79cd\u751f\u6210C\/C++\u4e0e\u591a\u79cd\u7f16\u7a0b\u8bed\u8a00\u4e4b\u95f4\u63a5\u53e3\u7684\u5de5\u5177\u3002\u901a\u8fc7SWIG\uff0c\u53ef\u4ee5\u751f\u6210Python\u6a21\u5757\uff0c\u4ece\u800c\u5728Python\u4e2d\u8c03\u7528C\/C++\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><h3>4.1 \u7f16\u5199C\u4ee3\u7801\u548cSWIG\u63a5\u53e3\u6587\u4ef6<\/h3>\n<\/p>\n<p><p>\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>example.c<\/code>\u7684C\u6587\u4ef6\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-c\">#include &lt;stdio.h&gt;<\/p>\n<p>void hello() {<\/p>\n<p>    printf(&quot;Hello from C!\\n&quot;);<\/p>\n<p>}<\/p>\n<p>int add(int a, int b) {<\/p>\n<p>    return a + b;<\/p>\n<p>}<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a<code>example.i<\/code>\u7684SWIG\u63a5\u53e3\u6587\u4ef6\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-c\">%module example<\/p>\n<p>%{<\/p>\n<p>#include &quot;example.h&quot;<\/p>\n<p>%}<\/p>\n<p>extern void hello();<\/p>\n<p>extern int add(int a, int b);<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>4.2 \u751f\u6210Python\u6a21\u5757<\/h3>\n<\/p>\n<p><p>\u4f7f\u7528SWIG\u751f\u6210Python\u6a21\u5757\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">swig -python -example.i<\/p>\n<p>gcc -shared -o _example.so -fPIC example_wrap.c example.c -I\/usr\/include\/python3.8<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>4.3 \u8c03\u7528SWIG\u751f\u6210\u7684\u6a21\u5757<\/h3>\n<\/p>\n<p><p>\u5728Python\u4e2d\u8c03\u7528SWIG\u751f\u6210\u7684\u6a21\u5757\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import example<\/p>\n<p>example.hello()<\/p>\n<p>result = example.add(5, 3)<\/p>\n<p>print(f&quot;The result of add is: {result}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>SWIG\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u5de5\u5177\uff0c\u9002\u7528\u4e8e\u9700\u8981\u5728\u591a\u79cd\u7f16\u7a0b\u8bed\u8a00\u4e4b\u95f4\u751f\u6210\u63a5\u53e3\u7684\u573a\u666f\u3002\u901a\u8fc7SWIG\uff0c\u53ef\u4ee5\u8f7b\u677e\u5728Python\u4e2d\u8c03\u7528\u590d\u6742\u7684C\/C++\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><p>\u603b\u7ed3\u6765\u8bf4\uff0cPython\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u8c03\u7528C\u7a0b\u5e8f\uff0c\u6bcf\u79cd\u65b9\u5f0f\u90fd\u6709\u5176\u9002\u7528\u7684\u573a\u666f\u548c\u4f18\u7f3a\u70b9\u3002<code>ctypes<\/code>\u9002\u5408\u76f4\u63a5\u8c03\u7528C\u52a8\u6001\u5e93\uff0cCython\u9002\u5408\u9700\u8981\u4f18\u5316\u6027\u80fd\u7684\u573a\u666f\uff0c<code>subprocess<\/code>\u9002\u7528\u4e8e\u8c03\u7528\u5916\u90e8C\u7a0b\u5e8f\uff0c\u800cSWIG\u5219\u9002\u5408\u591a\u8bed\u8a00\u96c6\u6210\u7684\u9700\u6c42\u3002\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u65b9\u5f0f\uff0c\u53ef\u4ee5\u5145\u5206\u53d1\u6325Python\u548cC\u7684\u4f18\u52bf\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u8c03\u7528C\u7a0b\u5e8f\u4ee5\u63d0\u9ad8\u6267\u884c\u6548\u7387\uff1f<\/strong><br \/>\u5728Python\u4e2d\u8c03\u7528C\u7a0b\u5e8f\u53ef\u4ee5\u663e\u8457\u63d0\u5347\u6027\u80fd\uff0c\u5c24\u5176\u662f\u5f53\u4f60\u9700\u8981\u5904\u7406\u5927\u91cf\u6570\u636e\u6216\u6267\u884c\u590d\u6742\u8ba1\u7b97\u65f6\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528Python\u7684ctypes\u5e93\u6216cffi\u5e93\u6765\u52a0\u8f7dC\u7f16\u5199\u7684\u5171\u4eab\u5e93\u3002\u901a\u8fc7\u8fd9\u4e9b\u5de5\u5177\uff0c\u4f60\u53ef\u4ee5\u76f4\u63a5\u8c03\u7528C\u51fd\u6570\uff0c\u4f20\u9012\u53c2\u6570\u5e76\u83b7\u53d6\u8fd4\u56de\u503c\u3002\u786e\u4fdd\u4f60\u5728\u7f16\u5199C\u4ee3\u7801\u65f6\u4f7f\u7528\u5408\u9002\u7684\u63a5\u53e3\uff0c\u5e76\u5728Python\u4e2d\u5904\u7406\u76f8\u5e94\u7684\u6570\u636e\u7c7b\u578b\u3002<\/p>\n<p><strong>\u8c03\u7528C\u7a0b\u5e8f\u65f6\u9700\u8981\u6ce8\u610f\u54ea\u4e9b\u7f16\u8bd1\u9009\u9879\uff1f<\/strong><br \/>\u5728\u5c06C\u4ee3\u7801\u7f16\u8bd1\u4e3a\u5171\u4eab\u5e93\u65f6\uff0c\u4f7f\u7528<code>-fPIC<\/code>\u9009\u9879\u662f\u5f88\u91cd\u8981\u7684\uff0c\u8fd9\u6709\u52a9\u4e8e\u751f\u6210\u4f4d\u7f6e\u65e0\u5173\u7684\u4ee3\u7801\uff0c\u786e\u4fdd\u5728\u52a8\u6001\u94fe\u63a5\u65f6\u80fd\u591f\u6b63\u786e\u52a0\u8f7d\u3002\u6b64\u5916\uff0c\u4f7f\u7528<code>-shared<\/code>\u9009\u9879\u53ef\u4ee5\u521b\u5efa\u5171\u4eab\u5e93\u6587\u4ef6\uff0c\u65b9\u4fbfPython\u8fdb\u884c\u8c03\u7528\u3002\u786e\u4fdd\u5728\u7f16\u8bd1\u65f6\u9488\u5bf9\u76ee\u6807\u5e73\u53f0\u9009\u62e9\u5408\u9002\u7684\u7f16\u8bd1\u5668\u548c\u9009\u9879\uff0c\u4ee5\u907f\u514d\u6f5c\u5728\u7684\u517c\u5bb9\u6027\u95ee\u9898\u3002<\/p>\n<p><strong>Python\u4e0eC\u7684\u4ea4\u4e92\u4f1a\u5e26\u6765\u54ea\u4e9b\u6027\u80fd\u4f18\u52bf\uff1f<\/strong><br \/>\u901a\u8fc7\u8c03\u7528C\u7a0b\u5e8f\uff0cPython\u53ef\u4ee5\u5229\u7528C\u8bed\u8a00\u7684\u9ad8\u6548\u6027\uff0c\u7279\u522b\u662f\u5728\u6570\u503c\u8ba1\u7b97\u3001\u56fe\u50cf\u5904\u7406\u548c\u79d1\u5b66\u8ba1\u7b97\u7b49\u9886\u57df\u3002C\u8bed\u8a00\u7684\u4f4e\u7ea7\u7279\u6027\u4f7f\u5176\u5728\u5904\u7406\u5927\u91cf\u6570\u636e\u65f6\u8868\u73b0\u51fa\u8272\uff0c\u51cf\u5c11\u4e86\u8ba1\u7b97\u65f6\u95f4\u3002\u540c\u65f6\uff0c\u4f7f\u7528C\u7f16\u5199\u7684\u7b97\u6cd5\u53ef\u4ee5\u5728Python\u4e2d\u8f7b\u677e\u590d\u7528\uff0c\u8fd9\u4e3a\u5f00\u53d1\u590d\u6742\u5e94\u7528\u63d0\u4f9b\u4e86\u66f4\u591a\u7684\u7075\u6d3b\u6027\u548c\u6548\u7387\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u51e0\u79cd\u65b9\u5f0f\u8c03\u7528C\u7a0b\u5e8f\uff1a\u4f7f\u7528ctypes\u5e93\u3001\u4f7f\u7528Cython\u3001\u901a\u8fc7subprocess\u6a21\u5757 [&hellip;]","protected":false},"author":3,"featured_media":962798,"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\/962790"}],"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=962790"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/962790\/revisions"}],"predecessor-version":[{"id":962802,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/962790\/revisions\/962802"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/962798"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=962790"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=962790"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=962790"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}