{"id":1000362,"date":"2024-12-27T09:49:24","date_gmt":"2024-12-27T01:49:24","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1000362.html"},"modified":"2024-12-27T09:49:26","modified_gmt":"2024-12-27T01:49:26","slug":"python%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8pyx%e6%96%87%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1000362.html","title":{"rendered":"python\u5982\u4f55\u4f7f\u7528pyx\u6587\u4ef6"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25074955\/8b3a4c64-f316-4420-ab98-29c9540407be.webp\" alt=\"python\u5982\u4f55\u4f7f\u7528pyx\u6587\u4ef6\" \/><\/p>\n<p><p> <strong>\u8981\u5728Python\u4e2d\u4f7f\u7528<code>.pyx<\/code>\u6587\u4ef6\uff0c\u53ef\u4ee5\u901a\u8fc7Cython\u8fdb\u884c\u7f16\u8bd1\u3001\u8c03\u7528\u3001\u6269\u5c55Python\u529f\u80fd\u3001\u63d0\u9ad8\u8ba1\u7b97\u6027\u80fd<\/strong>\u3002Cython\u662f\u4e00\u79cd\u7528\u4e8e\u7f16\u5199C\u6269\u5c55\u7684Python\u8bed\u8a00\u7684\u8d85\u96c6\uff0c\u5b83\u5141\u8bb8\u60a8\u5728Python\u4ee3\u7801\u4e2d\u5d4c\u5165C\u8bed\u8a00\u4ee3\u7801\uff0c\u4ece\u800c\u5927\u5e45\u63d0\u9ad8\u7a0b\u5e8f\u7684\u8fd0\u884c\u901f\u5ea6\u3002\u4f7f\u7528Cython\u7684\u4e3b\u8981\u6b65\u9aa4\u5305\u62ec\uff1a\u7f16\u5199<code>.pyx<\/code>\u6587\u4ef6\u3001\u7f16\u8bd1\u4e3aC\u6269\u5c55\u6a21\u5757\u3001\u5728Python\u4e2d\u5bfc\u5165\u548c\u4f7f\u7528\u8be5\u6a21\u5757\u3002\u4ee5\u4e0b\u662f\u8be6\u7ec6\u7684\u6b65\u9aa4\u548c\u6ce8\u610f\u4e8b\u9879\u3002<\/p>\n<\/p>\n<p><p>\u4e00\u3001\u7f16\u5199<code>.pyx<\/code>\u6587\u4ef6<\/p>\n<\/p>\n<p><p>\u5728\u5f00\u59cb\u4f7f\u7528Cython\u4e4b\u524d\uff0c\u9996\u5148\u9700\u8981\u7f16\u5199\u4e00\u4e2a<code>.pyx<\/code>\u6587\u4ef6\u3002\u8fd9\u4e2a\u6587\u4ef6\u5305\u542b\u4e86\u8981\u52a0\u901f\u7684Python\u4ee3\u7801\u4ee5\u53ca\u4efb\u4f55\u5d4c\u5165\u7684C\u8bed\u8a00\u4ee3\u7801\u3002<code>.pyx<\/code>\u6587\u4ef6\u4e0e\u666e\u901a\u7684Python\u811a\u672c\u7c7b\u4f3c\uff0c\u4f46\u5141\u8bb8\u4f7f\u7528C\u8bed\u8a00\u7684\u6570\u636e\u7c7b\u578b\u548c\u51fd\u6570\u3002<\/p>\n<\/p>\n<p><p>\u4f8b\u5982\uff0c\u6211\u4eec\u53ef\u4ee5\u5b9a\u4e49\u4e00\u4e2a\u7b80\u5355\u7684\u51fd\u6570\u6765\u8ba1\u7b97\u6590\u6ce2\u90a3\u5951\u6570\u5217\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># fibonacci.pyx<\/p>\n<p>def fib(int n):<\/p>\n<p>    cdef int i<\/p>\n<p>    cdef int a = 0, b = 1<\/p>\n<p>    for i in range(n):<\/p>\n<p>        a, b = b, a + b<\/p>\n<p>    return a<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u6bb5\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528<code>cdef<\/code>\u5173\u952e\u5b57\u6765\u58f0\u660eC\u8bed\u8a00\u7684\u6570\u636e\u7c7b\u578b\u3002\u8fd9\u79cd\u58f0\u660e\u65b9\u5f0f\u53ef\u4ee5\u5e2e\u52a9Cython\u751f\u6210\u66f4\u5feb\u7684C\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u7f16\u8bd1<code>.pyx<\/code>\u6587\u4ef6<\/p>\n<\/p>\n<p><p>\u7f16\u5199\u597d<code>.pyx<\/code>\u6587\u4ef6\u540e\uff0c\u9700\u8981\u5c06\u5176\u7f16\u8bd1\u4e3aC\u6269\u5c55\u6a21\u5757\u3002\u4e3a\u6b64\uff0cCython\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7f16\u8bd1\u5de5\u5177\uff0c\u53ef\u4ee5\u5c06<code>.pyx<\/code>\u6587\u4ef6\u8f6c\u6362\u4e3aC\u4ee3\u7801\uff0c\u5e76\u4f7f\u7528C\u7f16\u8bd1\u5668\u751f\u6210\u5171\u4eab\u5e93\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>\u7f16\u5199<code>setup.py<\/code><\/strong><\/li>\n<\/ol>\n<p><p>\u4e3a\u4e86\u7f16\u8bd1<code>.pyx<\/code>\u6587\u4ef6\uff0c\u901a\u5e38\u9700\u8981\u521b\u5efa\u4e00\u4e2a<code>setup.py<\/code>\u811a\u672c\u3002\u8fd9\u4e2a\u811a\u672c\u4f7f\u7528\u4e86<code>setuptools<\/code>\u548c<code>Cython<\/code>\u6a21\u5757\u6765\u914d\u7f6e\u7f16\u8bd1\u8fc7\u7a0b\u3002<\/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;fibonacci.pyx&quot;),<\/p>\n<p>)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u8fd0\u884c\u7f16\u8bd1\u547d\u4ee4<\/strong><\/li>\n<\/ol>\n<p><p>\u5728\u7ec8\u7aef\u4e2d\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u4ee5\u7f16\u8bd1<code>.pyx<\/code>\u6587\u4ef6\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><p>\u6b64\u547d\u4ee4\u5c06\u751f\u6210\u4e00\u4e2a\u5171\u4eab\u5e93\u6587\u4ef6\uff0c\u8be5\u6587\u4ef6\u53ef\u4ee5\u5728Python\u4e2d\u5bfc\u5165\u3002<\/p>\n<\/p>\n<p><p>\u4e09\u3001\u5728Python\u4e2d\u5bfc\u5165\u548c\u4f7f\u7528\u7f16\u8bd1\u540e\u7684\u6a21\u5757<\/p>\n<\/p>\n<p><p>\u7f16\u8bd1\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u5728Python\u7a0b\u5e8f\u4e2d\u5bfc\u5165\u751f\u6210\u7684\u5171\u4eab\u5e93\u6a21\u5757\uff0c\u5e76\u50cf\u4f7f\u7528\u666e\u901aPython\u6a21\u5757\u4e00\u6837\u8c03\u7528\u5176\u4e2d\u7684\u51fd\u6570\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import fibonacci<\/p>\n<p>print(fibonacci.fib(10))  # \u8f93\u51fa: 55<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u60a8\u53ef\u4ee5\u5728Python\u7a0b\u5e8f\u4e2d\u4f7f\u7528C\u8bed\u8a00\u7684\u6027\u80fd\u4f18\u52bf\uff0c\u540c\u65f6\u4fdd\u6301Python\u4ee3\u7801\u7684\u53ef\u8bfb\u6027\u548c\u7075\u6d3b\u6027\u3002<\/p>\n<\/p>\n<p><p>\u56db\u3001\u4f18\u5316\u548c\u8c03\u8bd5Cython\u4ee3\u7801<\/p>\n<\/p>\n<p><p>\u5728\u7f16\u5199\u548c\u4f7f\u7528Cython\u4ee3\u7801\u65f6\uff0c\u6709\u8bb8\u591a\u6280\u5de7\u53ef\u4ee5\u5e2e\u52a9\u60a8\u4f18\u5316\u6027\u80fd\u548c\u8fdb\u884c\u8c03\u8bd5\u3002<\/p>\n<\/p>\n<ol>\n<li><strong>\u7c7b\u578b\u58f0\u660e\u548c\u7c7b\u578b\u63a8\u5bfc<\/strong><\/li>\n<\/ol>\n<p><p>\u5728Cython\u4e2d\uff0c\u660e\u786e\u58f0\u660e\u53d8\u91cf\u7684\u7c7b\u578b\u53ef\u4ee5\u663e\u8457\u63d0\u9ad8\u6027\u80fd\u3002Cython\u4e5f\u53ef\u4ee5\u81ea\u52a8\u63a8\u5bfc\u4e00\u4e9b\u7c7b\u578b\uff0c\u4f46\u624b\u52a8\u58f0\u660e\u901a\u5e38\u4f1a\u66f4\u9ad8\u6548\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u4f7f\u7528<code>cdef<\/code>\u51fd\u6570<\/strong><\/li>\n<\/ol>\n<p><p>\u5bf9\u4e8e\u4e0d\u9700\u8981\u66b4\u9732\u7ed9Python\u5916\u90e8\u8c03\u7528\u7684\u51fd\u6570\uff0c\u4f7f\u7528<code>cdef<\/code>\u5173\u952e\u5b57\u6765\u5b9a\u4e49\u8fd9\u4e9b\u51fd\u6570\uff0c\u4ee5\u4fbf\u4e8e\u751f\u6210\u66f4\u5feb\u7684C\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">cdef int c_fib(int n):<\/p>\n<p>    cdef int i, a = 0, b = 1<\/p>\n<p>    for i in range(n):<\/p>\n<p>        a, b = b, a + b<\/p>\n<p>    return a<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"3\">\n<li><strong>\u4f7f\u7528<code>cpdef<\/code>\u51fd\u6570<\/strong><\/li>\n<\/ol>\n<p><p><code>cpdef<\/code>\u5173\u952e\u5b57\u5141\u8bb8\u51fd\u6570\u540c\u65f6\u88abPython\u548cC\u8c03\u7528\uff0c\u4f7f\u5176\u65e2\u7075\u6d3b\u53c8\u9ad8\u6548\u3002<\/p>\n<\/p>\n<ol start=\"4\">\n<li><strong>\u8c03\u8bd5\u5de5\u5177<\/strong><\/li>\n<\/ol>\n<p><p>\u4f7f\u7528<code>cythonize<\/code>\u7684<code>annotate=True<\/code>\u9009\u9879\u53ef\u4ee5\u751f\u6210HTML\u6587\u4ef6\uff0c\u5e2e\u52a9\u53ef\u89c6\u5316\u4ee3\u7801\u4e2dPython\u4e0eC\u4e4b\u95f4\u7684\u8f6c\u6362\u60c5\u51b5\u3002\u8fd9\u5bf9\u4e8e\u5206\u6790\u548c\u4f18\u5316\u6027\u80fd\u975e\u5e38\u6709\u7528\u3002<\/p>\n<\/p>\n<p><p>\u4e94\u3001\u96c6\u6210Cython\u5230\u73b0\u6709\u9879\u76ee<\/p>\n<\/p>\n<p><p>\u5728\u5927\u578b\u9879\u76ee\u4e2d\uff0c\u5c06Cython\u96c6\u6210\u5230\u73b0\u6709\u4ee3\u7801\u5e93\u4e2d\u53ef\u4ee5\u663e\u8457\u63d0\u9ad8\u6027\u80fd\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5efa\u8bae\uff1a<\/p>\n<\/p>\n<ol>\n<li><strong>\u9009\u62e9\u5408\u9002\u7684\u6a21\u5757<\/strong><\/li>\n<\/ol>\n<p><p>\u9996\u5148\uff0c\u8bc6\u522b\u90a3\u4e9b\u8ba1\u7b97\u5bc6\u96c6\u578b\u6216\u6027\u80fd\u74f6\u9888\u7684\u6a21\u5757\uff0c\u5c06\u5176\u8f6c\u5316\u4e3aCython\u6a21\u5757\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u9010\u6b65\u8f6c\u6362<\/strong><\/li>\n<\/ol>\n<p><p>\u9010\u6b65\u8f6c\u6362\u4ee3\u7801\uff0c\u5148\u4ece\u5173\u952e\u51fd\u6570\u5f00\u59cb\uff0c\u7136\u540e\u9010\u6b65\u6269\u5c55\u5230\u5176\u4ed6\u90e8\u5206\u3002\u8fd9\u6837\u53ef\u4ee5\u786e\u4fdd\u5728\u6bcf\u4e2a\u9636\u6bb5\u90fd\u80fd\u68c0\u6d4b\u5e76\u89e3\u51b3\u6f5c\u5728\u7684\u95ee\u9898\u3002<\/p>\n<\/p>\n<ol start=\"3\">\n<li><strong>\u7ed3\u5408NumPy<\/strong><\/li>\n<\/ol>\n<p><p>\u5bf9\u4e8e\u6d89\u53ca\u5927\u91cf\u6570\u503c\u8fd0\u7b97\u7684\u4ee3\u7801\uff0c\u7ed3\u5408\u4f7f\u7528NumPy\u548cCython\u53ef\u4ee5\u83b7\u5f97\u66f4\u5927\u7684\u6027\u80fd\u63d0\u5347\u3002Cython\u4e0eNumPy\u7684\u914d\u5408\u53ef\u4ee5\u663e\u8457\u51cf\u5c11\u8fd0\u7b97\u65f6\u95f4\u3002<\/p>\n<\/p>\n<ol start=\"4\">\n<li><strong>\u6301\u7eed\u6d4b\u8bd5<\/strong><\/li>\n<\/ol>\n<p><p>\u5728\u8f6c\u6362\u548c\u4f18\u5316\u8fc7\u7a0b\u4e2d\uff0c\u6301\u7eed\u8fdb\u884c\u5355\u5143\u6d4b\u8bd5\u548c\u6027\u80fd\u6d4b\u8bd5\uff0c\u4ee5\u786e\u4fdd\u4ee3\u7801\u7684\u6b63\u786e\u6027\u548c\u6027\u80fd\u63d0\u5347\u3002<\/p>\n<\/p>\n<p><p>\u516d\u3001\u5e38\u89c1\u95ee\u9898\u548c\u89e3\u51b3\u65b9\u6848<\/p>\n<\/p>\n<p><p>\u5728\u4f7f\u7528Cython\u7684\u8fc7\u7a0b\u4e2d\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u4e00\u4e9b\u5e38\u89c1\u95ee\u9898\uff1a<\/p>\n<\/p>\n<ol>\n<li><strong>\u7f16\u8bd1\u9519\u8bef<\/strong><\/li>\n<\/ol>\n<p><p>\u786e\u4fdd\u6240\u6709\u4f9d\u8d56\u5e93\u548cCython\u7248\u672c\u517c\u5bb9\uff0c\u5e76\u68c0\u67e5<code>setup.py<\/code>\u6587\u4ef6\u4e2d\u7684\u8bbe\u7f6e\u662f\u5426\u6b63\u786e\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li><strong>\u6027\u80fd\u672a\u63d0\u5347<\/strong><\/li>\n<\/ol>\n<p><p>\u901a\u8fc7\u589e\u52a0\u7c7b\u578b\u58f0\u660e\u3001\u4f7f\u7528\u66f4\u9ad8\u6548\u7684\u7b97\u6cd5\u6216\u6570\u636e\u7ed3\u6784\u6765\u4f18\u5316\u4ee3\u7801\u3002<\/p>\n<\/p>\n<ol start=\"3\">\n<li><strong>\u5185\u5b58\u7ba1\u7406<\/strong><\/li>\n<\/ol>\n<p><p>\u6ce8\u610fC\u8bed\u8a00\u7684\u5185\u5b58\u7ba1\u7406\uff0c\u786e\u4fdd\u6ca1\u6709\u5185\u5b58\u6cc4\u6f0f\u95ee\u9898\u3002Cython\u63d0\u4f9b\u4e86\u4e00\u4e9b\u5185\u5b58\u7ba1\u7406\u5de5\u5177\u548c\u9009\u9879\uff0c\u53ef\u4ee5\u5e2e\u52a9\u7ba1\u7406\u5185\u5b58\u3002<\/p>\n<\/p>\n<p><p>\u901a\u8fc7\u7cfb\u7edf\u5730\u4f7f\u7528Cython\uff0c\u60a8\u53ef\u4ee5\u5728\u4e0d\u727a\u7272Python\u7075\u6d3b\u6027\u7684\u60c5\u51b5\u4e0b\uff0c\u5927\u5e45\u63d0\u9ad8\u7a0b\u5e8f\u7684\u6027\u80fd\u3002Cython\u63d0\u4f9b\u4e86\u4e00\u79cd\u5f3a\u5927\u4e14\u7075\u6d3b\u7684\u65b9\u5f0f\u6765\u5229\u7528C\u8bed\u8a00\u7684\u6027\u80fd\uff0c\u800c\u4e0d\u5fc5\u5b8c\u5168\u653e\u5f03Python\u7684\u4f18\u52bf\u3002\u65e0\u8bba\u662f\u52a0\u901f\u73b0\u6709\u7684Python\u9879\u76ee\uff0c\u8fd8\u662f\u5f00\u53d1\u65b0\u7684\u9ad8\u6027\u80fd\u5e94\u7528\uff0cCython\u90fd\u662f\u4e00\u4e2a\u503c\u5f97\u63a2\u7d22\u7684\u5de5\u5177\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u5bfc\u5165\u548c\u4f7f\u7528pyx\u6587\u4ef6\uff1f<\/strong><br \/>\u8981\u5728Python\u4e2d\u4f7f\u7528pyx\u6587\u4ef6\uff0c\u60a8\u9700\u8981\u5148\u5b89\u88c5Cython\uff0c\u8fd9\u662f\u4e00\u4e2a\u5c06Python\u4ee3\u7801\u7f16\u8bd1\u4e3aC\u8bed\u8a00\u7684\u5de5\u5177\u3002\u901a\u8fc7\u8fd0\u884c<code>pip install cython<\/code>\u6765\u8fdb\u884c\u5b89\u88c5\u3002\u63a5\u7740\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528Cython\u63d0\u4f9b\u7684<code>setup.py<\/code>\u6587\u4ef6\u6765\u7f16\u8bd1pyx\u6587\u4ef6\u3002\u521b\u5efa\u4e00\u4e2asetup.py\u6587\u4ef6\uff0c\u5185\u5bb9\u5305\u62ec<code>from setuptools import setup<\/code>\u548c<code>from Cython.Build import cythonize<\/code>\u3002\u7136\u540e\uff0c\u8fd0\u884c<code>python setup.py build_ext --inplace<\/code>\u547d\u4ee4\uff0c\u5c06pyx\u6587\u4ef6\u7f16\u8bd1\u4e3aPython\u53ef\u4ee5\u76f4\u63a5\u8c03\u7528\u7684\u6a21\u5757\u3002<\/p>\n<p><strong>pyx\u6587\u4ef6\u548c\u666e\u901aPython\u6587\u4ef6\u6709\u4ec0\u4e48\u533a\u522b\uff1f<\/strong><br \/>pyx\u6587\u4ef6\u4e3b\u8981\u7528\u4e8eCython\uff0c\u5b83\u5141\u8bb8\u60a8\u5728Python\u4ee3\u7801\u4e2d\u76f4\u63a5\u4f7f\u7528C\u8bed\u8a00\u7684\u7279\u6027\uff0c\u4ece\u800c\u63d0\u9ad8\u4ee3\u7801\u7684\u6267\u884c\u6548\u7387\u3002\u4e0e\u666e\u901a\u7684Python\u6587\u4ef6\u4e0d\u540c\uff0cpyx\u6587\u4ef6\u901a\u5e38\u5305\u542bC\u8bed\u8a00\u7684\u7c7b\u578b\u58f0\u660e\u548c\u51fd\u6570\uff0c\u8fd9\u4e9b\u7279\u6027\u4f7f\u5f97\u4ee3\u7801\u5728\u6027\u80fd\u4e0a\u66f4\u52a0\u4f18\u5316\uff0c\u7279\u522b\u9002\u5408\u9700\u8981\u8fdb\u884c\u5927\u91cf\u8ba1\u7b97\u7684\u5e94\u7528\u3002<\/p>\n<p><strong>\u5728\u4f7f\u7528pyx\u6587\u4ef6\u65f6\uff0c\u5982\u4f55\u5904\u7406\u4f9d\u8d56\u5e93\uff1f<\/strong><br \/>\u5f53\u60a8\u5728pyx\u6587\u4ef6\u4e2d\u4f7f\u7528\u5916\u90e8\u4f9d\u8d56\u5e93\u65f6\uff0c\u786e\u4fdd\u5728setup.py\u6587\u4ef6\u4e2d\u6b63\u786e\u914d\u7f6e\u4f9d\u8d56\u9879\u3002\u53ef\u4ee5\u901a\u8fc7<code>include_dirs<\/code>\u53c2\u6570\u6307\u5b9a\u5934\u6587\u4ef6\u8def\u5f84\uff0c\u4f7f\u7528<code>libraries<\/code>\u53c2\u6570\u6307\u5b9a\u9700\u8981\u94fe\u63a5\u7684\u5e93\u3002\u540c\u65f6\uff0c\u786e\u4fdd\u5728\u4ee3\u7801\u4e2d\u5305\u542b\u5fc5\u8981\u7684import\u8bed\u53e5\uff0c\u4ee5\u4fbfCython\u80fd\u591f\u6b63\u786e\u8bc6\u522b\u548c\u4f7f\u7528\u8fd9\u4e9b\u5e93\u7684\u529f\u80fd\u3002\u8fd9\u6837\uff0c\u60a8\u5c31\u53ef\u4ee5\u987a\u5229\u5730\u5728pyx\u6587\u4ef6\u4e2d\u4f7f\u7528\u5916\u90e8\u5e93\uff0c\u63d0\u9ad8\u4ee3\u7801\u7684\u529f\u80fd\u6027\u548c\u7075\u6d3b\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8981\u5728Python\u4e2d\u4f7f\u7528.pyx\u6587\u4ef6\uff0c\u53ef\u4ee5\u901a\u8fc7Cython\u8fdb\u884c\u7f16\u8bd1\u3001\u8c03\u7528\u3001\u6269\u5c55Python\u529f\u80fd\u3001\u63d0\u9ad8\u8ba1\u7b97\u6027\u80fd\u3002C [&hellip;]","protected":false},"author":3,"featured_media":1000368,"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\/1000362"}],"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=1000362"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1000362\/revisions"}],"predecessor-version":[{"id":1000369,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1000362\/revisions\/1000369"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1000368"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1000362"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1000362"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1000362"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}