{"id":1069671,"date":"2025-01-08T10:51:08","date_gmt":"2025-01-08T02:51:08","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1069671.html"},"modified":"2025-01-08T10:51:10","modified_gmt":"2025-01-08T02:51:10","slug":"%e5%a6%82%e4%bd%95%e7%94%a8python%e5%af%b9%e5%ad%97%e5%85%b8%e9%94%ae%e5%80%bc%e5%af%b9%e4%ba%a4%e6%8d%a2-2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1069671.html","title":{"rendered":"\u5982\u4f55\u7528python\u5bf9\u5b57\u5178\u952e\u503c\u5bf9\u4ea4\u6362"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25100635\/e0456543-5c1d-4f05-98fa-01cf9cead143.webp\" alt=\"\u5982\u4f55\u7528python\u5bf9\u5b57\u5178\u952e\u503c\u5bf9\u4ea4\u6362\" \/><\/p>\n<p><p> <strong>\u5982\u4f55\u7528Python\u5bf9\u5b57\u5178\u952e\u503c\u5bf9\u4ea4\u6362<\/strong><\/p>\n<\/p>\n<p><p>\u5728Python\u4e2d\uff0c\u4ea4\u6362\u5b57\u5178\u7684\u952e\u548c\u503c\u53ef\u4ee5\u901a\u8fc7\u51e0\u79cd\u4e0d\u540c\u7684\u65b9\u6cd5\u6765\u5b9e\u73b0\u3002<strong>\u4f7f\u7528\u5b57\u5178\u63a8\u5bfc\u5f0f\u3001\u4f7f\u7528for\u5faa\u73af\u3001\u4f7f\u7528\u5185\u7f6e\u51fd\u6570<\/strong>\u662f\u6700\u5e38\u89c1\u7684\u51e0\u79cd\u65b9\u6cd5\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u63a2\u8ba8\u8fd9\u4e9b\u65b9\u6cd5\uff0c\u5e2e\u52a9\u4f60\u9009\u62e9\u6700\u5408\u9002\u7684\u65b9\u6cd5\u6765\u8fdb\u884c\u952e\u503c\u5bf9\u4ea4\u6362\u3002\u6211\u4eec\u5c06\u91cd\u70b9\u4ecb\u7ecd<strong>\u5b57\u5178\u63a8\u5bfc\u5f0f<\/strong>\u8fd9\u4e00\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528\u5b57\u5178\u63a8\u5bfc\u5f0f<\/h3>\n<\/p>\n<p><p>\u5b57\u5178\u63a8\u5bfc\u5f0f\u662f\u4e00\u79cd\u7b80\u6d01\u800c\u9ad8\u6548\u7684\u65b9\u6cd5\uff0c\u7528\u4e8e\u521b\u5efa\u65b0\u7684\u5b57\u5178\u3002\u901a\u8fc7\u5b57\u5178\u63a8\u5bfc\u5f0f\uff0c\u53ef\u4ee5\u975e\u5e38\u65b9\u4fbf\u5730\u4ea4\u6362\u5b57\u5178\u4e2d\u7684\u952e\u548c\u503c\u3002\u4e0b\u9762\u662f\u4e00\u4e2a\u4f8b\u5b50\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">original_dict = {&#39;a&#39;: 1, &#39;b&#39;: 2, &#39;c&#39;: 3}<\/p>\n<p>swapped_dict = {value: key for key, value in original_dict.items()}<\/p>\n<p>print(swapped_dict)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c<code>original_dict.items()<\/code>\u8fd4\u56de\u4e00\u4e2a\u5305\u542b\u6240\u6709\u952e\u503c\u5bf9\u7684\u89c6\u56fe\u5bf9\u8c61\u3002\u5b57\u5178\u63a8\u5bfc\u5f0f <code>{value: key for key, value in original_dict.items()}<\/code> \u521b\u5efa\u4e86\u4e00\u4e2a\u65b0\u7684\u5b57\u5178\uff0c\u5176\u4e2d\u952e\u548c\u503c\u5df2\u7ecf\u4ea4\u6362\u3002<\/p>\n<\/p>\n<p><p><strong>\u8be6\u7ec6\u63cf\u8ff0\uff1a<\/strong><\/p>\n<\/p>\n<p><p>\u5b57\u5178\u63a8\u5bfc\u5f0f\u7684\u8bed\u6cd5\u7c7b\u4f3c\u4e8e\u5217\u8868\u63a8\u5bfc\u5f0f\uff0c\u4f46\u5b83\u4f7f\u7528\u82b1\u62ec\u53f7 <code>{}<\/code> \u6765\u521b\u5efa\u5b57\u5178\u3002\u5728\u63a8\u5bfc\u5f0f\u5185\u90e8\uff0c\u6211\u4eec\u6307\u5b9a\u4e86\u65b0\u7684\u952e\u548c\u503c\u7684\u5bf9\u5e94\u5173\u7cfb\u3002\u5728\u4e0a\u9762\u7684\u4f8b\u5b50\u4e2d\uff0c<code>value: key<\/code> \u8868\u793a\u65b0\u5b57\u5178\u7684\u952e\u662f\u539f\u5b57\u5178\u7684\u503c\uff0c\u800c\u65b0\u5b57\u5178\u7684\u503c\u662f\u539f\u5b57\u5178\u7684\u952e\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528for\u5faa\u73af<\/h3>\n<\/p>\n<p><p>\u5c3d\u7ba1\u5b57\u5178\u63a8\u5bfc\u5f0f\u662f\u4e00\u4e2a\u975e\u5e38\u7b80\u6d01\u7684\u65b9\u6cd5\uff0c\u4f46\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u4f7f\u7528for\u5faa\u73af\u53ef\u80fd\u66f4\u52a0\u76f4\u89c2\uff0c\u7279\u522b\u662f\u5bf9\u4e8e\u590d\u6742\u7684\u64cd\u4f5c\u3002\u4e0b\u9762\u662f\u4e00\u4e2a\u4f7f\u7528for\u5faa\u73af\u7684\u4f8b\u5b50\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">original_dict = {&#39;a&#39;: 1, &#39;b&#39;: 2, &#39;c&#39;: 3}<\/p>\n<p>swapped_dict = {}<\/p>\n<p>for key, value in original_dict.items():<\/p>\n<p>    swapped_dict[value] = key<\/p>\n<p>print(swapped_dict)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u6211\u4eec\u9996\u5148\u521b\u5efa\u4e00\u4e2a\u7a7a\u5b57\u5178 <code>swapped_dict<\/code>\uff0c\u7136\u540e\u904d\u5386 <code>original_dict.items()<\/code>\uff0c\u5c06\u6bcf\u4e2a\u952e\u503c\u5bf9\u7684\u503c\u548c\u952e\u5206\u522b\u8d4b\u503c\u7ed9 <code>swapped_dict<\/code> \u7684\u952e\u548c\u503c\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u4f7f\u7528\u5185\u7f6e\u51fd\u6570<\/h3>\n<\/p>\n<p><p>\u867d\u7136Python\u6ca1\u6709\u76f4\u63a5\u63d0\u4f9b\u7528\u4e8e\u4ea4\u6362\u5b57\u5178\u952e\u503c\u5bf9\u7684\u5185\u7f6e\u51fd\u6570\uff0c\u4f46\u6211\u4eec\u53ef\u4ee5\u5229\u7528\u4e00\u4e9b\u5185\u7f6e\u51fd\u6570\u548c\u65b9\u6cd5\u6765\u5b9e\u73b0\u8fd9\u4e00\u70b9\u3002\u4f8b\u5982\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528<code>zip()<\/code>\u51fd\u6570\u7ed3\u5408\u5b57\u5178\u6784\u9020\u51fd\u6570 <code>dict()<\/code> \u6765\u5b9e\u73b0\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">original_dict = {&#39;a&#39;: 1, &#39;b&#39;: 2, &#39;c&#39;: 3}<\/p>\n<p>swapped_dict = dict(zip(original_dict.values(), original_dict.keys()))<\/p>\n<p>print(swapped_dict)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c<code>zip(original_dict.values(), original_dict.keys())<\/code> \u521b\u5efa\u4e86\u4e00\u4e2a\u5305\u542b\u539f\u5b57\u5178\u503c\u548c\u952e\u7684\u5143\u7ec4\u7684\u8fed\u4ee3\u5668\u3002\u7136\u540e\uff0c\u6211\u4eec\u4f7f\u7528 <code>dict()<\/code> \u5c06\u8fd9\u4e9b\u5143\u7ec4\u8f6c\u6362\u4e3a\u5b57\u5178\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u5904\u7406\u91cd\u590d\u503c\u7684\u60c5\u51b5<\/h3>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u5b57\u5178\u7684\u503c\u53ef\u80fd\u5e76\u4e0d\u552f\u4e00\u3002\u5982\u679c\u503c\u91cd\u590d\uff0c\u76f4\u63a5\u4ea4\u6362\u952e\u548c\u503c\u53ef\u80fd\u4f1a\u5bfc\u81f4\u6570\u636e\u4e22\u5931\u3002\u4e3a\u4e86\u5904\u7406\u8fd9\u79cd\u60c5\u51b5\uff0c\u6211\u4eec\u53ef\u4ee5\u5c06\u503c\u6620\u5c04\u5230\u4e00\u4e2a\u5305\u542b\u6240\u6709\u5bf9\u5e94\u952e\u7684\u5217\u8868\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">original_dict = {&#39;a&#39;: 1, &#39;b&#39;: 2, &#39;c&#39;: 1}<\/p>\n<p>swapped_dict = {}<\/p>\n<p>for key, value in original_dict.items():<\/p>\n<p>    if value not in swapped_dict:<\/p>\n<p>        swapped_dict[value] = [key]<\/p>\n<p>    else:<\/p>\n<p>        swapped_dict[value].append(key)<\/p>\n<p>print(swapped_dict)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u5982\u679c <code>value<\/code> \u5c1a\u672a\u5728 <code>swapped_dict<\/code> \u4e2d\uff0c\u6211\u4eec\u5c06\u5b83\u6620\u5c04\u5230\u4e00\u4e2a\u5305\u542b\u5f53\u524d\u952e\u7684\u5217\u8868\u3002\u5982\u679c <code>value<\/code> \u5df2\u7ecf\u5b58\u5728\uff0c\u6211\u4eec\u5c06\u5f53\u524d\u952e\u8ffd\u52a0\u5230\u5217\u8868\u4e2d\u3002<\/p>\n<\/p>\n<p><h3>\u4e94\u3001\u7ed3\u5408\u5176\u4ed6\u6570\u636e\u7ed3\u6784<\/h3>\n<\/p>\n<p><p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u4f60\u53ef\u80fd\u9700\u8981\u7ed3\u5408\u5176\u4ed6\u6570\u636e\u7ed3\u6784\u6765\u5904\u7406\u952e\u503c\u5bf9\u4ea4\u6362\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4f60\u9700\u8981\u786e\u4fdd\u4ea4\u6362\u540e\u7684\u952e\u503c\u5bf9\u7684\u987a\u5e8f\uff0c\u53ef\u4ee5\u4f7f\u7528 <code>OrderedDict<\/code>\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">from collections import OrderedDict<\/p>\n<p>original_dict = {&#39;a&#39;: 1, &#39;b&#39;: 2, &#39;c&#39;: 3}<\/p>\n<p>swapped_dict = OrderedDict((value, key) for key, value in original_dict.items())<\/p>\n<p>print(swapped_dict)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4f7f\u7528 <code>OrderedDict<\/code> \u53ef\u4ee5\u786e\u4fdd\u4ea4\u6362\u540e\u7684\u5b57\u5178\u4fdd\u6301\u4e0e\u539f\u5b57\u5178\u76f8\u540c\u7684\u987a\u5e8f\u3002<\/p>\n<\/p>\n<p><h3>\u516d\u3001\u6027\u80fd\u6bd4\u8f83<\/h3>\n<\/p>\n<p><p>\u5bf9\u4e8e\u5927\u591a\u6570\u60c5\u51b5\uff0c\u4f7f\u7528\u5b57\u5178\u63a8\u5bfc\u5f0f\u662f\u6700\u5feb\u7684\u65b9\u6cd5\uff0c\u56e0\u4e3a\u5b83\u662f\u7528C\u8bed\u8a00\u5b9e\u73b0\u7684\uff0c\u6548\u7387\u975e\u5e38\u9ad8\u3002\u7136\u800c\uff0c\u5bf9\u4e8e\u975e\u5e38\u5927\u7684\u5b57\u5178\uff0c\u6027\u80fd\u5dee\u5f02\u53ef\u80fd\u53d8\u5f97\u663e\u8457\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528 <code>timeit<\/code> \u6a21\u5757\u6765\u6bd4\u8f83\u4e0d\u540c\u65b9\u6cd5\u7684\u6027\u80fd\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">import timeit<\/p>\n<p>original_dict = {i: chr(65 + i) for i in range(10000)}<\/p>\n<h2><strong>\u5b57\u5178\u63a8\u5bfc\u5f0f<\/strong><\/h2>\n<p>time1 = timeit.timeit(&#39;swapped_dict = {value: key for key, value in original_dict.items()}&#39;, globals=globals(), number=1000)<\/p>\n<h2><strong>for\u5faa\u73af<\/strong><\/h2>\n<p>time2 = timeit.timeit(&#39;&#39;&#39;<\/p>\n<p>swapped_dict = {}<\/p>\n<p>for key, value in original_dict.items():<\/p>\n<p>    swapped_dict[value] = key<\/p>\n<p>&#39;&#39;&#39;, globals=globals(), number=1000)<\/p>\n<h2><strong>zip\u51fd\u6570<\/strong><\/h2>\n<p>time3 = timeit.timeit(&#39;swapped_dict = dict(zip(original_dict.values(), original_dict.keys()))&#39;, globals=globals(), number=1000)<\/p>\n<p>print(f&quot;\u5b57\u5178\u63a8\u5bfc\u5f0f: {time1}&quot;)<\/p>\n<p>print(f&quot;for\u5faa\u73af: {time2}&quot;)<\/p>\n<p>print(f&quot;zip\u51fd\u6570: {time3}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u901a\u8fc7\u8fd9\u4e9b\u6d4b\u8bd5\uff0c\u4f60\u53ef\u4ee5\u9009\u62e9\u6700\u9002\u5408\u4f60\u9700\u6c42\u7684\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><h3>\u4e03\u3001\u5b9e\u9645\u5e94\u7528\u573a\u666f<\/h3>\n<\/p>\n<p><p>\u4ea4\u6362\u5b57\u5178\u7684\u952e\u548c\u503c\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\u6709\u5f88\u591a\u7528\u9014\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<ol>\n<li><strong>\u6570\u636e\u8f6c\u6362<\/strong>\uff1a\u5728\u6570\u636e\u6e05\u6d17\u548c\u8f6c\u6362\u8fc7\u7a0b\u4e2d\uff0c\u53ef\u80fd\u9700\u8981\u4ea4\u6362\u952e\u548c\u503c\u6765\u6ee1\u8db3\u7279\u5b9a\u7684\u9700\u6c42\u3002<\/li>\n<li><strong>\u53cd\u5411\u67e5\u627e<\/strong>\uff1a\u6709\u65f6\u9700\u8981\u901a\u8fc7\u503c\u6765\u67e5\u627e\u5bf9\u5e94\u7684\u952e\uff0c\u8fd9\u65f6\u4ea4\u6362\u952e\u548c\u503c\u53ef\u4ee5\u7b80\u5316\u67e5\u627e\u8fc7\u7a0b\u3002<\/li>\n<li><strong>\u56fe\u8bba<\/strong>\uff1a\u5728\u56fe\u8bba\u4e2d\uff0c\u4ea4\u6362\u8282\u70b9\u548c\u8fb9\u7684\u5173\u7cfb\u53ef\u80fd\u6709\u52a9\u4e8e\u67d0\u4e9b\u7b97\u6cd5\u7684\u5b9e\u73b0\u3002<\/li>\n<\/ol>\n<p><h3>\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u672c\u6587\u8be6\u7ec6\u4ecb\u7ecd\u4e86\u5982\u4f55\u7528Python\u5bf9\u5b57\u5178\u952e\u503c\u5bf9\u8fdb\u884c\u4ea4\u6362\uff0c\u4e3b\u8981\u5305\u62ec\u4f7f\u7528\u5b57\u5178\u63a8\u5bfc\u5f0f\u3001for\u5faa\u73af\u548c\u5185\u7f6e\u51fd\u6570\u7684\u65b9\u6cd5\u3002<strong>\u5b57\u5178\u63a8\u5bfc\u5f0f<\/strong>\u662f\u4e00\u79cd\u7b80\u6d01\u800c\u9ad8\u6548\u7684\u65b9\u6cd5\uff0c\u9002\u7528\u4e8e\u5927\u591a\u6570\u60c5\u51b5\u3002\u5bf9\u4e8e\u5904\u7406\u91cd\u590d\u503c\u548c\u5176\u4ed6\u7279\u6b8a\u60c5\u51b5\uff0c\u53ef\u4ee5\u7ed3\u5408\u5176\u4ed6\u6570\u636e\u7ed3\u6784\u548c\u65b9\u6cd5\u3002\u901a\u8fc7\u6027\u80fd\u6bd4\u8f83\uff0c\u4f60\u53ef\u4ee5\u9009\u62e9\u6700\u9002\u5408\u4f60\u9700\u6c42\u7684\u65b9\u6cd5\u3002\u5e0c\u671b\u672c\u6587\u80fd\u5e2e\u52a9\u4f60\u66f4\u597d\u5730\u7406\u89e3\u548c\u5e94\u7528\u8fd9\u4e9b\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u9ad8\u6548\u5730\u4ea4\u6362\u5b57\u5178\u7684\u952e\u503c\u5bf9\uff1f<\/strong><br \/>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u5b57\u5178\u63a8\u5bfc\u5f0f\u6765\u9ad8\u6548\u5730\u4ea4\u6362\u952e\u503c\u5bf9\u3002\u5177\u4f53\u65b9\u6cd5\u662f\u4f7f\u7528<code>{v: k for k, v in original_dict.items()}<\/code>\u7684\u8bed\u6cd5\u6765\u6784\u5efa\u4e00\u4e2a\u65b0\u7684\u5b57\u5178\uff0c\u5176\u4e2d\u539f\u6765\u7684\u503c\u6210\u4e3a\u65b0\u5b57\u5178\u7684\u952e\uff0c\u800c\u539f\u6765\u7684\u952e\u6210\u4e3a\u65b0\u5b57\u5178\u7684\u503c\u3002\u8fd9\u79cd\u65b9\u6cd5\u7b80\u6d01\u4e14\u5177\u6709\u826f\u597d\u7684\u53ef\u8bfb\u6027\u3002<\/p>\n<p><strong>\u4ea4\u6362\u5b57\u5178\u952e\u503c\u5bf9\u540e\uff0c\u5982\u4f55\u5904\u7406\u91cd\u590d\u503c\u7684\u95ee\u9898\uff1f<\/strong><br \/>\u5982\u679c\u539f\u59cb\u5b57\u5178\u4e2d\u6709\u91cd\u590d\u503c\uff0c\u4ea4\u6362\u540e\u4f1a\u5bfc\u81f4\u4fe1\u606f\u4e22\u5931\uff0c\u56e0\u4e3a\u5b57\u5178\u7684\u952e\u662f\u552f\u4e00\u7684\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u53ef\u4ee5\u8003\u8651\u4f7f\u7528<code>defaultdict<\/code>\u6216\u5c06\u503c\u5b58\u50a8\u4e3a\u5217\u8868\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u4f7f\u7528<code>defaultdict(list)<\/code>\u6765\u5b58\u50a8\u6bcf\u4e2a\u952e\u5bf9\u5e94\u7684\u6240\u6709\u539f\u59cb\u952e\uff0c\u4ee5\u6b64\u907f\u514d\u4fe1\u606f\u7684\u4e22\u5931\u3002<\/p>\n<p><strong>\u5728\u4ea4\u6362\u5b57\u5178\u7684\u952e\u503c\u5bf9\u65f6\uff0c\u5982\u4f55\u786e\u4fdd\u4ee3\u7801\u7684\u5065\u58ee\u6027\uff1f<\/strong><br \/>\u786e\u4fdd\u4ee3\u7801\u5065\u58ee\u6027\u7684\u65b9\u6cd5\u4e4b\u4e00\u662f\u68c0\u67e5\u5b57\u5178\u7684\u503c\u662f\u5426\u662f\u53ef\u54c8\u5e0c\u7684\u3002\u56e0\u4e3a\u5b57\u5178\u7684\u952e\u5fc5\u987b\u662f\u4e0d\u53ef\u53d8\u7684\u7c7b\u578b\uff08\u5982\u5b57\u7b26\u4e32\u3001\u6570\u5b57\u3001\u5143\u7ec4\u7b49\uff09\u3002\u5728\u4ea4\u6362\u4e4b\u524d\uff0c\u53ef\u4ee5\u4f7f\u7528<code>isinstance(value, Hashable)<\/code>\u6765\u9a8c\u8bc1\u6bcf\u4e2a\u503c\u662f\u5426\u7b26\u5408\u6761\u4ef6\uff0c\u8fd9\u6837\u53ef\u4ee5\u907f\u514d\u5728\u8fd0\u884c\u65f6\u51fa\u73b0\u5f02\u5e38\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5982\u4f55\u7528Python\u5bf9\u5b57\u5178\u952e\u503c\u5bf9\u4ea4\u6362 \u5728Python\u4e2d\uff0c\u4ea4\u6362\u5b57\u5178\u7684\u952e\u548c\u503c\u53ef\u4ee5\u901a\u8fc7\u51e0\u79cd\u4e0d\u540c\u7684\u65b9\u6cd5\u6765\u5b9e\u73b0\u3002\u4f7f\u7528\u5b57\u5178\u63a8 [&hellip;]","protected":false},"author":3,"featured_media":1069686,"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\/1069671"}],"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=1069671"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1069671\/revisions"}],"predecessor-version":[{"id":1069689,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1069671\/revisions\/1069689"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1069686"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1069671"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1069671"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1069671"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}