{"id":4749,"date":"2020-08-30T00:21:55","date_gmt":"2020-08-29T16:21:55","guid":{"rendered":"http:\/\/www.menglanglang.cn\/?p=4749"},"modified":"2024-04-21T11:59:20","modified_gmt":"2024-04-21T03:59:20","slug":"python-%e6%a0%bc%e8%a8%80%ef%bc%88the-zen-of-python%ef%bc%89","status":"publish","type":"post","link":"http:\/\/www.menglanglang.cn\/?p=4749","title":{"rendered":"Python \u683c\u8a00\uff08The Zen of Python\uff09"},"content":{"rendered":"\n<p>Python \u7684\u8bbe\u8ba1\u54f2\u5b66\u662f\u201c\u4f18\u96c5\u201d\u3001\u201c\u660e\u786e\u201d\u3001\u201c\u7b80\u5355\u201d\u3002\u56e0\u6b64\uff0cPerl \u8bed\u8a00\u4e2d\u201c\u603b\u662f\u6709\u591a\u79cd\u65b9\u6cd5\u6765\u505a\u540c\u4e00\u4ef6\u4e8b\u201d\u7684\u7406\u5ff5\u5728 Python \u5f00\u53d1\u8005\u4e2d\u901a\u5e38\u662f\u96be\u4ee5\u5fcd\u53d7\u7684\u3002Python \u5f00\u53d1\u8005\u7684\u54f2\u5b66\u662f\u201c\u7528\u4e00\u79cd\u65b9\u6cd5\uff0c\u6700\u597d\u662f\u53ea\u6709\u4e00\u79cd\u65b9\u6cd5\u6765\u505a\u4e00\u4ef6\u4e8b\u201d\u3002\u5728\u8bbe\u8ba1 Python \u8bed\u8a00\u65f6\uff0c\u5982\u679c\u9762\u4e34\u591a\u79cd\u9009\u62e9\uff0cPython \u5f00\u53d1\u8005\u4e00\u822c\u4f1a\u62d2\u7edd\u82b1\u4fcf\u7684\u8bed\u6cd5\uff0c\u800c\u9009\u62e9\u660e\u786e\u7684\u6ca1\u6709\u6216\u8005\u5f88\u5c11\u6709\u6b67\u4e49\u7684\u8bed\u6cd5\u3002\u7531\u4e8e\u8fd9\u79cd\u8bbe\u8ba1\u89c2\u5ff5\u7684\u5dee\u5f02\uff0cPython \u6e90\u4ee3\u7801\u901a\u5e38\u88ab\u8ba4\u4e3a\u6bd4      Perl \u5177\u5907\u66f4\u597d\u7684\u53ef\u8bfb\u6027\uff0c\u5e76\u4e14\u80fd\u591f\u652f\u6491\u5927\u89c4\u6a21\u7684\u8f6f\u4ef6\u5f00\u53d1\u3002\u8fd9\u4e9b\u51c6\u5219\u88ab\u79f0\u4e3aPython \u683c\u8a00\u3002<\/p>\n\n\n\n<p>\u5728 Python \u89e3\u91ca\u5668\u5185\u8fd0\u884c import this \u53ef\u4ee5\u83b7\u5f97\u5b8c\u6574\u7684\u5217\u8868\uff0c\u5982\u56fe\u6240\u793a\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"522\" src=\"http:\/\/www.menglanglang.cn\/wp-content\/uploads\/2020\/08\/Python-Zen-1024x522.png\" alt=\"\" class=\"wp-image-4750\" srcset=\"http:\/\/www.menglanglang.cn\/wp-content\/uploads\/2020\/08\/Python-Zen-1024x522.png 1024w, http:\/\/www.menglanglang.cn\/wp-content\/uploads\/2020\/08\/Python-Zen-300x153.png 300w, http:\/\/www.menglanglang.cn\/wp-content\/uploads\/2020\/08\/Python-Zen-768x391.png 768w, http:\/\/www.menglanglang.cn\/wp-content\/uploads\/2020\/08\/Python-Zen.png 1223w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption>The Zen of Python, by Tim Peters<\/figcaption><\/figure>\n\n\n\n<p class=\"has-text-color has-background has-text-align-center has-medium-font-size has-pale-cyan-blue-color has-vivid-cyan-blue-background-color\"><strong><em>Beautiful is better than ugly.<br \/>Explicit is better than implicit.<br \/>Simple is better than complex.<br \/>Complex is better than complicated.<br \/>Flat is better than nested.<br \/>Sparse is better than dense.<br \/>Readability counts.<br \/>Special cases aren't special enough to break the rules.<br \/>Although practicality beats purity.<br \/>Errors should never pass silently.<br \/>Unless explicitly silenced.<br \/>In the face of ambiguity, refuse the temptation to guess.<br \/>There should be one-- and preferably only one --obvious way to do it.<br \/>Although that way may not be obvious at first unless you're Dutch.<br \/>Now is better than never.<br \/>Although never is often better than right now.<br \/>If the implementation is hard to explain, it's a bad idea.<br \/>If the implementation is easy to explain, it may be a good idea.<br \/>Namespaces are one honking great idea -- let's do more of those!<\/em><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Python \u7684\u8bbe\u8ba1\u54f2\u5b66\u662f\u201c\u4f18\u96c5\u201d\u3001\u201c\u660e\u786e\u201d\u3001\u201c\u7b80\u5355\u201d\u3002\u56e0\u6b64\uff0cPerl \u8bed\u8a00\u4e2d\u201c\u603b\u662f\u6709\u591a\u79cd\u65b9\u6cd5\u6765\u505a\u540c\u4e00\u4ef6\u4e8b\u201d\u7684 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[812],"tags":[813,381,814],"class_list":["post-4749","post","type-post","status-publish","format-standard","hentry","category-python","tag-python","tag-381","tag-814"],"_links":{"self":[{"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=\/wp\/v2\/posts\/4749","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4749"}],"version-history":[{"count":4,"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=\/wp\/v2\/posts\/4749\/revisions"}],"predecessor-version":[{"id":4754,"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=\/wp\/v2\/posts\/4749\/revisions\/4754"}],"wp:attachment":[{"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4749"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4749"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.menglanglang.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4749"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}