{"id":1072002,"date":"2025-01-08T11:12:18","date_gmt":"2025-01-08T03:12:18","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1072002.html"},"modified":"2025-01-08T11:12:21","modified_gmt":"2025-01-08T03:12:21","slug":"python%e7%9a%84%e4%b8%ad%e6%96%87%e5%ad%97%e7%ac%a6%e5%a6%82%e4%bd%95%e6%8e%92%e5%ba%8f-2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1072002.html","title":{"rendered":"python\u7684\u4e2d\u6587\u5b57\u7b26\u5982\u4f55\u6392\u5e8f"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25102351\/7ce83a80-a5ab-435b-9058-6d2e12aace3f.webp\" alt=\"python\u7684\u4e2d\u6587\u5b57\u7b26\u5982\u4f55\u6392\u5e8f\" \/><\/p>\n<p><p> <strong>Python\u6392\u5e8f\u4e2d\u6587\u5b57\u7b26\u7684\u65b9\u6cd5\u5305\u62ec\uff1a\u4f7f\u7528\u5185\u7f6e\u7684<code>sorted<\/code>\u51fd\u6570\u3001\u4f7f\u7528<code>locale<\/code>\u6a21\u5757\u3001\u4f7f\u7528<code>pinyin<\/code>\u5e93\u3002<\/strong>\u5728\u8fd9\u4e9b\u65b9\u6cd5\u4e2d\uff0c\u6700\u5e38\u89c1\u4e14\u6709\u6548\u7684\u65b9\u6cd5\u662f\u4f7f\u7528<code>pinyin<\/code>\u5e93\uff0c\u5b83\u53ef\u4ee5\u6839\u636e\u6c49\u5b57\u7684\u62fc\u97f3\u987a\u5e8f\u8fdb\u884c\u6392\u5e8f\u3002\u8fd9\u5728\u5904\u7406\u4e2d\u6587\u5b57\u7b26\u65f6\u5c24\u5176\u6709\u7528\uff0c\u56e0\u4e3a\u62fc\u97f3\u6392\u5e8f\u66f4\u7b26\u5408\u4e2d\u6587\u7684\u8bed\u8a00\u4e60\u60ef\u3002<\/p>\n<\/p>\n<p><p><strong>\u4f7f\u7528<code>pinyin<\/code>\u5e93\u8fdb\u884c\u6392\u5e8f\uff1a<\/strong><\/p>\n<p><code>pinyin<\/code>\u5e93\u53ef\u4ee5\u5c06\u4e2d\u6587\u5b57\u7b26\u8f6c\u6362\u4e3a\u62fc\u97f3\uff0c\u7136\u540e\u6839\u636e\u62fc\u97f3\u6765\u6392\u5e8f\u3002\u4f8b\u5982\uff0c\u6211\u4eec\u6709\u4e00\u4e2a\u5305\u542b\u4e2d\u6587\u5b57\u7b26\u7684\u5217\u8868\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528<code>pinyin<\/code>\u5e93\u5c06\u8fd9\u4e9b\u5b57\u7b26\u8f6c\u6362\u4e3a\u62fc\u97f3\u5e76\u8fdb\u884c\u6392\u5e8f\u3002\u8fd9\u79cd\u65b9\u6cd5\u5bf9\u4e2d\u6587\u5b57\u7b26\u7684\u5904\u7406\u66f4\u52a0\u51c6\u786e\u548c\u81ea\u7136\u3002\u4e0b\u9762\u662f\u8be6\u7ec6\u7684\u4ecb\u7ecd\uff1a<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528<code>sorted<\/code>\u51fd\u6570<\/h3>\n<\/p>\n<p><p>Python\u5185\u7f6e\u7684<code>sorted<\/code>\u51fd\u6570\u53ef\u4ee5\u76f4\u63a5\u5bf9\u4e2d\u6587\u5b57\u7b26\u8fdb\u884c\u6392\u5e8f\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u662f\u6309\u7167Unicode\u7f16\u7801\u8fdb\u884c\u6392\u5e8f\u3002\u867d\u7136\u8fd9\u79cd\u6392\u5e8f\u65b9\u6cd5\u53ef\u4ee5\u7528\uff0c\u4f46\u7ed3\u679c\u5e76\u4e0d\u4f1a\u5b8c\u5168\u7b26\u5408\u62fc\u97f3\u6392\u5e8f\u7684\u4e60\u60ef\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">chinese_chars = [&#39;\u82f9\u679c&#39;, &#39;\u9999\u8549&#39;, &#39;\u68a8&#39;, &#39;\u6a59\u5b50&#39;]<\/p>\n<p>sorted_chars = sorted(chinese_chars)<\/p>\n<p>print(sorted_chars)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u8f93\u51fa\uff1a<\/strong><\/p>\n<\/p>\n<p><pre><code>[&#39;\u68a8&#39;, &#39;\u6a59\u5b50&#39;, &#39;\u82f9\u679c&#39;, &#39;\u9999\u8549&#39;]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u79cd\u6392\u5e8f\u7ed3\u679c\u662f\u6309\u7167Unicode\u7f16\u7801\u7684\u987a\u5e8f\u6765\u7684\uff0c\u53ef\u80fd\u5e76\u4e0d\u662f\u6211\u4eec\u671f\u671b\u7684\u62fc\u97f3\u987a\u5e8f\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528<code>locale<\/code>\u6a21\u5757<\/h3>\n<\/p>\n<p><p><code>locale<\/code>\u6a21\u5757\u53ef\u4ee5\u7528\u6765\u8bbe\u7f6e\u7a0b\u5e8f\u7684\u5730\u533a\u548c\u8bed\u8a00\u73af\u5883\uff0c\u4f46\u5176\u5bf9\u4e2d\u6587\u6392\u5e8f\u7684\u652f\u6301\u6709\u9650\uff0c\u9700\u8981\u5728\u7279\u5b9a\u7684\u7cfb\u7edf\u548c\u73af\u5883\u4e0b\u624d\u80fd\u6b63\u5e38\u5de5\u4f5c\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f8b\u5b50\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import locale<\/p>\n<p>locale.setlocale(locale.LC_COLLATE, &#39;zh_CN.UTF-8&#39;)<\/p>\n<p>chinese_chars = [&#39;\u82f9\u679c&#39;, &#39;\u9999\u8549&#39;, &#39;\u68a8&#39;, &#39;\u6a59\u5b50&#39;]<\/p>\n<p>sorted_chars = sorted(chinese_chars, key=locale.strxfrm)<\/p>\n<p>print(sorted_chars)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u8f93\u51fa\uff1a<\/strong><\/p>\n<\/p>\n<p><pre><code>[&#39;\u68a8&#39;, &#39;\u6a59\u5b50&#39;, &#39;\u82f9\u679c&#39;, &#39;\u9999\u8549&#39;]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u79cd\u65b9\u6cd5\u5728\u67d0\u4e9b\u7cfb\u7edf\u4e0b\u53ef\u80fd\u65e0\u6cd5\u6b63\u5e38\u5de5\u4f5c\uff0c\u5c24\u5176\u662f\u5728Windows\u7cfb\u7edf\u4e2d\uff0c<code>locale<\/code>\u6a21\u5757\u5bf9\u4e2d\u6587\u6392\u5e8f\u7684\u652f\u6301\u5e76\u4e0d\u5b8c\u5584\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u4f7f\u7528<code>pinyin<\/code>\u5e93<\/h3>\n<\/p>\n<p><p><code>pinyin<\/code>\u5e93\u662f\u5904\u7406\u4e2d\u6587\u5b57\u7b26\u6392\u5e8f\u7684\u6700\u4f73\u9009\u62e9\uff0c\u5b83\u53ef\u4ee5\u5c06\u6c49\u5b57\u8f6c\u6362\u4e3a\u62fc\u97f3\uff0c\u7136\u540e\u6839\u636e\u62fc\u97f3\u8fdb\u884c\u6392\u5e8f\u3002\u5b89\u88c5<code>pinyin<\/code>\u5e93\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">pip install pypinyin<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4f7f\u7528<code>pinyin<\/code>\u5e93\u8fdb\u884c\u4e2d\u6587\u5b57\u7b26\u6392\u5e8f\u7684\u793a\u4f8b\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from pypinyin import pinyin, lazy_pinyin<\/p>\n<p>chinese_chars = [&#39;\u82f9\u679c&#39;, &#39;\u9999\u8549&#39;, &#39;\u68a8&#39;, &#39;\u6a59\u5b50&#39;]<\/p>\n<p>sorted_chars = sorted(chinese_chars, key=lambda x: lazy_pinyin(x))<\/p>\n<p>print(sorted_chars)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u8f93\u51fa\uff1a<\/strong><\/p>\n<\/p>\n<p><pre><code>[&#39;\u6a59\u5b50&#39;, &#39;\u68a8&#39;, &#39;\u82f9\u679c&#39;, &#39;\u9999\u8549&#39;]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u79cd\u65b9\u6cd5\u80fd\u591f\u6309\u7167\u6c49\u5b57\u7684\u62fc\u97f3\u987a\u5e8f\u8fdb\u884c\u6392\u5e8f\uff0c\u66f4\u52a0\u7b26\u5408\u4e2d\u6587\u7684\u8bed\u8a00\u4e60\u60ef\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u62fc\u97f3\u6392\u5e8f\u7684\u7ec6\u8282\u5904\u7406<\/h3>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u62fc\u97f3\u6392\u5e8f\u8fd8\u9700\u8981\u8003\u8651\u591a\u97f3\u5b57\u548c\u5176\u4ed6\u7ec6\u8282\u95ee\u9898\u3002<code>pinyin<\/code>\u5e93\u63d0\u4f9b\u4e86\u66f4\u9ad8\u7ea7\u7684\u529f\u80fd\u6765\u5904\u7406\u8fd9\u4e9b\u95ee\u9898\uff0c\u4f8b\u5982\u4f7f\u7528<code>Style<\/code>\u53c2\u6570\u6765\u6307\u5b9a\u62fc\u97f3\u7684\u6837\u5f0f\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from pypinyin import pinyin, Style<\/p>\n<p>chinese_chars = [&#39;\u884c&#39;, &#39;\u94f6\u884c&#39;, &#39;\u884c\u8d70&#39;, &#39;\u884c\u674e&#39;]<\/p>\n<p>sorted_chars = sorted(chinese_chars, key=lambda x: pinyin(x, style=Style.TONE3))<\/p>\n<p>print(sorted_chars)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u8f93\u51fa\uff1a<\/strong><\/p>\n<\/p>\n<p><pre><code>[&#39;\u884c\u8d70&#39;, &#39;\u884c\u674e&#39;, &#39;\u884c&#39;, &#39;\u94f6\u884c&#39;]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u6307\u5b9a\u62fc\u97f3\u7684\u6837\u5f0f\uff0c\u53ef\u4ee5\u66f4\u51c6\u786e\u5730\u5904\u7406\u591a\u97f3\u5b57\u548c\u5176\u4ed6\u7279\u6b8a\u60c5\u51b5\u3002<\/p>\n<\/p>\n<p><h3>\u4e94\u3001\u5b9e\u9645\u5e94\u7528\u4e2d\u7684\u4e2d\u6587\u6392\u5e8f<\/h3>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u4e2d\u6587\u6392\u5e8f\u53ef\u80fd\u6d89\u53ca\u66f4\u591a\u590d\u6742\u7684\u573a\u666f\uff0c\u4f8b\u5982\u5904\u7406\u5305\u542b\u4e2d\u6587\u548c\u82f1\u6587\u6df7\u5408\u7684\u5b57\u7b26\u4e32\u3001\u5904\u7406\u5e26\u6709\u6807\u70b9\u7b26\u53f7\u7684\u5b57\u7b26\u4e32\u7b49\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5b9e\u9645\u5e94\u7528\u4e2d\u7684\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<p><h4>1\u3001\u5904\u7406\u5305\u542b\u4e2d\u6587\u548c\u82f1\u6587\u6df7\u5408\u7684\u5b57\u7b26\u4e32<\/h4>\n<\/p>\n<p><p>\u5f53\u5b57\u7b26\u4e32\u4e2d\u5305\u542b\u4e2d\u6587\u548c\u82f1\u6587\u5b57\u7b26\u65f6\uff0c\u53ef\u4ee5\u5c06\u4e2d\u6587\u5b57\u7b26\u8f6c\u6362\u4e3a\u62fc\u97f3\uff0c\u7136\u540e\u8fdb\u884c\u6392\u5e8f\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from pypinyin import lazy_pinyin<\/p>\n<p>mixed_strings = [&#39;apple&#39;, &#39;\u9999\u8549&#39;, &#39;banana&#39;, &#39;\u82f9\u679c&#39;]<\/p>\n<p>sorted_strings = sorted(mixed_strings, key=lambda x: lazy_pinyin(x) if not x.isascii() else [x])<\/p>\n<p>print(sorted_strings)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u8f93\u51fa\uff1a<\/strong><\/p>\n<\/p>\n<p><pre><code>[&#39;apple&#39;, &#39;banana&#39;, &#39;\u82f9\u679c&#39;, &#39;\u9999\u8549&#39;]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2\u3001\u5904\u7406\u5e26\u6709\u6807\u70b9\u7b26\u53f7\u7684\u5b57\u7b26\u4e32<\/h4>\n<\/p>\n<p><p>\u5904\u7406\u5e26\u6709\u6807\u70b9\u7b26\u53f7\u7684\u5b57\u7b26\u4e32\u65f6\uff0c\u53ef\u4ee5\u5148\u53bb\u9664\u6807\u70b9\u7b26\u53f7\uff0c\u518d\u8fdb\u884c\u62fc\u97f3\u6392\u5e8f\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import re<\/p>\n<p>from pypinyin import lazy_pinyin<\/p>\n<p>def remove_punctuation(text):<\/p>\n<p>    return re.sub(r&#39;[^\\w\\s]&#39;, &#39;&#39;, text)<\/p>\n<p>chinese_strings = [&#39;\u82f9\u679c!&#39;, &#39;\u9999\u8549\u3002&#39;, &#39;\u68a8\uff1f&#39;, &#39;\u6a59\u5b50\uff0c&#39;]<\/p>\n<p>cleaned_strings = [remove_punctuation(s) for s in chinese_strings]<\/p>\n<p>sorted_strings = sorted(cleaned_strings, key=lambda x: lazy_pinyin(x))<\/p>\n<p>print(sorted_strings)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p><strong>\u8f93\u51fa\uff1a<\/strong><\/p>\n<\/p>\n<p><pre><code>[&#39;\u6a59\u5b50&#39;, &#39;\u68a8&#39;, &#39;\u82f9\u679c&#39;, &#39;\u9999\u8549&#39;]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u79cd\u65b9\u6cd5\u53ef\u4ee5\u6709\u6548\u5730\u5904\u7406\u5e26\u6709\u6807\u70b9\u7b26\u53f7\u7684\u5b57\u7b26\u4e32\uff0c\u786e\u4fdd\u6392\u5e8f\u7ed3\u679c\u7684\u51c6\u786e\u6027\u3002<\/p>\n<\/p>\n<p><h3>\u516d\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u5728\u5904\u7406\u4e2d\u6587\u5b57\u7b26\u6392\u5e8f\u65f6\uff0c\u4f7f\u7528<code>pinyin<\/code>\u5e93\u662f\u6700\u4f73\u9009\u62e9\uff0c\u56e0\u4e3a\u5b83\u53ef\u4ee5\u6839\u636e\u62fc\u97f3\u987a\u5e8f\u8fdb\u884c\u6392\u5e8f\uff0c\u66f4\u7b26\u5408\u4e2d\u6587\u7684\u8bed\u8a00\u4e60\u60ef\u3002\u867d\u7136Python\u5185\u7f6e\u7684<code>sorted<\/code>\u51fd\u6570\u548c<code>locale<\/code>\u6a21\u5757\u4e5f\u53ef\u4ee5\u7528\u6765\u6392\u5e8f\uff0c\u4f46\u5b83\u4eec\u7684\u6548\u679c\u5e76\u4e0d\u7406\u60f3\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u8fd8\u9700\u8981\u8003\u8651\u591a\u97f3\u5b57\u3001\u6df7\u5408\u5b57\u7b26\u548c\u6807\u70b9\u7b26\u53f7\u7b49\u590d\u6742\u60c5\u51b5\uff0c\u4f7f\u7528<code>pinyin<\/code>\u5e93\u63d0\u4f9b\u7684\u9ad8\u7ea7\u529f\u80fd\u53ef\u4ee5\u66f4\u597d\u5730\u5904\u7406\u8fd9\u4e9b\u95ee\u9898\u3002\u901a\u8fc7\u4e0a\u8ff0\u65b9\u6cd5\u548c\u793a\u4f8b\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u8fdb\u884c\u4e2d\u6587\u5b57\u7b26\u6392\u5e8f\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\u5bf9Python\u4e2d\u7684\u4e2d\u6587\u5b57\u7b26\u8fdb\u884c\u6392\u5e8f\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u5185\u7f6e\u7684<code>sorted()<\/code>\u51fd\u6570\u6765\u5bf9\u4e2d\u6587\u5b57\u7b26\u8fdb\u884c\u6392\u5e8f\u3002\u8be5\u51fd\u6570\u80fd\u591f\u5904\u7406Unicode\u5b57\u7b26\uff0c\u56e0\u6b64\u53ef\u4ee5\u6b63\u786e\u5904\u7406\u4e2d\u6587\u5b57\u7b26\u7684\u6392\u5e8f\u3002\u901a\u5e38\uff0c\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6e<code>key<\/code>\u53c2\u6570\u6765\u6307\u5b9a\u6392\u5e8f\u7684\u89c4\u5219\uff0c\u4f8b\u5982\u4f7f\u7528<code>locale<\/code>\u6a21\u5757\u6765\u786e\u4fdd\u6309\u6c49\u5b57\u7684\u62fc\u97f3\u987a\u5e8f\u8fdb\u884c\u6392\u5e8f\u3002<\/p>\n<p><strong>\u5728\u6392\u5e8f\u4e2d\u6587\u5b57\u7b26\u65f6\u9700\u8981\u6ce8\u610f\u54ea\u4e9b\u95ee\u9898\uff1f<\/strong><br \/>\u6392\u5e8f\u4e2d\u6587\u5b57\u7b26\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u4e00\u4e9b\u6311\u6218\uff0c\u4f8b\u5982\u5b57\u7b26\u7f16\u7801\u95ee\u9898\u548c\u4e0d\u540c\u6392\u5e8f\u89c4\u5219\u7684\u9002\u7528\u6027\u3002\u786e\u4fdd\u6240\u6709\u5b57\u7b26\u90fd\u4f7f\u7528\u76f8\u540c\u7684\u7f16\u7801\u683c\u5f0f\uff08\u5982UTF-8\uff09\u662f\u5f88\u91cd\u8981\u7684\u3002\u6b64\u5916\uff0c\u4e2d\u6587\u5b57\u7b26\u7684\u6392\u5e8f\u4e0d\u4ec5\u53ef\u4ee5\u6309\u62fc\u97f3\uff0c\u4e5f\u53ef\u4ee5\u6309\u7167\u7b14\u753b\u3001\u90e8\u9996\u7b49\u5176\u4ed6\u89c4\u5219\u8fdb\u884c\uff0c\u5177\u4f53\u53d6\u51b3\u4e8e\u5e94\u7528\u573a\u666f\u3002<\/p>\n<p><strong>\u662f\u5426\u53ef\u4ee5\u5bf9\u5305\u542b\u4e2d\u6587\u5b57\u7b26\u7684\u5b57\u7b26\u4e32\u5217\u8868\u8fdb\u884c\u6392\u5e8f\uff1f<\/strong><br \/>\u7edd\u5bf9\u53ef\u4ee5\u3002\u5bf9\u4e8e\u5305\u542b\u4e2d\u6587\u5b57\u7b26\u7684\u5b57\u7b26\u4e32\u5217\u8868\uff0c\u53ef\u4ee5\u4f7f\u7528<code>sorted()<\/code>\u51fd\u6570\u6216\u5217\u8868\u7684<code>sort()<\/code>\u65b9\u6cd5\u3002\u8fd9\u4e9b\u65b9\u6cd5\u4f1a\u9010\u4e2a\u6bd4\u8f83\u5b57\u7b26\u4e32\uff0c\u4f9d\u636e\u5176Unicode\u503c\u8fdb\u884c\u6392\u5e8f\u3002\u4e3a\u4e86\u83b7\u5f97\u66f4\u7b26\u5408\u4e60\u60ef\u7684\u6392\u5e8f\u7ed3\u679c\uff0c\u53ef\u80fd\u9700\u8981\u81ea\u5b9a\u4e49\u6392\u5e8f\u89c4\u5219\uff0c\u4f8b\u5982\u901a\u8fc7\u62fc\u97f3\u6392\u5e8f\u6216\u4f7f\u7528<code>locale<\/code>\u6a21\u5757\u6765\u83b7\u5f97\u66f4\u81ea\u7136\u7684\u6392\u5e8f\u6548\u679c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u6392\u5e8f\u4e2d\u6587\u5b57\u7b26\u7684\u65b9\u6cd5\u5305\u62ec\uff1a\u4f7f\u7528\u5185\u7f6e\u7684sorted\u51fd\u6570\u3001\u4f7f\u7528locale\u6a21\u5757\u3001\u4f7f\u7528pinyin\u5e93\u3002\u5728\u8fd9 [&hellip;]","protected":false},"author":3,"featured_media":1072009,"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\/1072002"}],"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=1072002"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1072002\/revisions"}],"predecessor-version":[{"id":1072010,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1072002\/revisions\/1072010"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1072009"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1072002"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1072002"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1072002"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}