{"id":34384,"date":"2023-06-13T23:46:55","date_gmt":"2023-06-13T15:46:55","guid":{"rendered":"https:\/\/docs.pingcode.com\/?p=34384"},"modified":"2023-07-31T02:10:45","modified_gmt":"2023-07-30T18:10:45","slug":"python%e7%9a%84%e6%80%a7%e8%83%bd%e5%a6%82%e4%bd%95","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/34384.html","title":{"rendered":"Python\u7684\u6027\u80fd\u5982\u4f55"},"content":{"rendered":"<blockquote class=\"wp-block-quote\">\n<p>Python\u5728\u6027\u80fd\u65b9\u9762\u4f1a\u5b58\u5728\u4e00\u4e9b\u9650\u5236\uff0c\u7279\u522b\u662f\u5728\u5bf9\u901f\u5ea6\u8981\u6c42\u6781\u9ad8\u7684\u9886\u57df\u3002\u4f46\u901a\u8fc7\u4f7f\u7528\u7f16\u8bd1\u5668\u3001\u4f18\u5316\u7b97\u6cd5\u3001\u5e76\u884c\u5904\u7406\u7b49\u6280\u672f\uff0c\u4ee5\u53ca\u5408\u7406\u9009\u62e9\u9002\u5408\u7684\u5e94\u7528\u573a\u666f\uff0cPython\u5728\u8bb8\u591a\u60c5\u51b5\u4e0b\u4ecd\u7136\u80fd\u591f\u63d0\u4f9b\u4ee4\u4eba\u6ee1\u610f\u7684\u6027\u80fd\u8868\u73b0\u3002\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u5c06\u63a2\u8ba8Python\u7684\u6027\u80fd\u8868\u73b0\uff0c\u5e76\u6df1\u5165\u4e86\u89e3\u5176\u4f18\u70b9\u548c\u7f3a\u70b9\u3002<\/p>\n<\/blockquote>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img fetchpriority=\"high\" alt=\"Python\u7684\u6027\u80fd\u5982\u4f55\" class=\"wp-image-34385\" decoding=\"async\" height=\"421\" sizes=\"(max-width: 680px) 100vw, 680px\" src=\"https:\/\/cdn-docs.pingcode.com\/wp-content\/uploads\/2023\/06\/13-1.jpeg?x-oss-process=image\/auto-orient,1\/format,webp\" srcset=\"https:\/\/cdn-docs.pingcode.com\/wp-content\/uploads\/2023\/06\/13-1.jpeg?x-oss-process=image\/auto-orient,1\/format,webp 680w, https:\/\/cdn-docs.pingcode.com\/wp-content\/uploads\/2023\/06\/13-1-300x186.jpeg 300w\" width=\"680\"\/><\/figure>\n<\/div>\n<h2 class=\"wp-block-heading\">\u4e00\u3001Python\u7684\u89e3\u91ca\u6267\u884c<\/h2>\n<p>Python\u662f\u4e00\u79cd\u89e3\u91ca\u578b\u8bed\u8a00\uff0c\u8fd9\u610f\u5473\u7740\u4ee3\u7801\u5728\u8fd0\u884c\u4e4b\u524d\u4f1a\u88ab\u89e3\u91ca\u5668\u9010\u884c\u89e3\u6790\u5e76\u6267\u884c\u3002\u4e0e\u7f16\u8bd1\u578b\u8bed\u8a00\u76f8\u6bd4\uff0c\u8fd9\u79cd\u89e3\u91ca\u6267\u884c\u65b9\u5f0f\u53ef\u80fd\u5bfc\u81f4Python\u7684\u6027\u80fd\u76f8\u5bf9\u8f83\u4f4e\u3002\u89e3\u91ca\u5668\u9700\u8981\u5728\u8fd0\u884c\u65f6\u52a8\u6001\u5730\u89e3\u6790\u4ee3\u7801\uff0c\u5e76\u8fdb\u884c\u7c7b\u578b\u63a8\u65ad\u548c\u5185\u5b58\u7ba1\u7406\u7b49\u64cd\u4f5c\uff0c\u8fd9\u4f1a\u5e26\u6765\u4e00\u5b9a\u7684\u5f00\u9500\u3002\u56e0\u6b64\uff0c\u5bf9\u4e8e\u90a3\u4e9b\u5bf9\u6027\u80fd\u8981\u6c42\u6781\u9ad8\u7684\u4efb\u52a1\uff0cPython\u53ef\u80fd\u4e0d\u662f\u4f18\u5f02\u9009\u62e9\u3002<\/p>\n<h2 class=\"wp-block-heading\">\u4e8c\u3001Python\u7684\u901f\u5ea6\u4f18\u5316<\/h2>\n<p>\u5c3d\u7ba1Python\u7684\u89e3\u91ca\u6267\u884c\u65b9\u5f0f\u53ef\u80fd\u5e26\u6765\u4e00\u4e9b\u6027\u80fd\u4e0a\u7684\u52a3\u52bf\uff0c\u4f46Python\u793e\u533a\u548c\u5f00\u53d1\u8005\u4eec\u4e00\u76f4\u5728\u81f4\u529b\u4e8e\u63d0\u9ad8\u5176\u901f\u5ea6\u3002\u4ed6\u4eec\u91c7\u53d6\u4e86\u4e00\u7cfb\u5217\u7684\u4f18\u5316\u63aa\u65bd\uff0c\u4f7f\u5f97Python\u5728\u8bb8\u591a\u573a\u666f\u4e0b\u80fd\u591f\u8868\u73b0\u51fa\u4ee4\u4eba\u6ee1\u610f\u7684\u6027\u80fd\u3002<\/p>\n<p><strong>1\u3001\u4f7f\u7528\u7f16\u8bd1\u5668<\/strong><\/p>\n<p>\u4e3a\u4e86\u63d0\u9ad8Python\u7684\u6267\u884c\u901f\u5ea6\uff0c\u4e00\u4e9b\u9879\u76ee\u91c7\u7528\u4e86\u5373\u65f6\u7f16\u8bd1\uff08Just-In-Time\uff0cJIT\uff09\u6280\u672f\uff0c\u5982PyPy\u548cNumba\u3002\u8fd9\u4e9b\u7f16\u8bd1\u5668\u53ef\u4ee5\u5c06Python\u4ee3\u7801\u8f6c\u6362\u4e3a\u673a\u5668\u4ee3\u7801\uff0c\u4ece\u800c\u63d0\u9ad8\u6267\u884c\u6548\u7387\u3002<\/p>\n<p><strong>2\u3001C\u8bed\u8a00\u6269\u5c55<\/strong><\/p>\n<p>Python\u63d0\u4f9b\u4e86\u4e0eC\u8bed\u8a00\u7684\u7d27\u5bc6\u96c6\u6210\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u4f7f\u7528C\u8bed\u8a00\u7f16\u5199\u6027\u80fd\u5173\u952e\u7684\u6a21\u5757\uff0c\u5e76\u901a\u8fc7Python\u7684C API\u4e0ePython\u89e3\u91ca\u5668\u8fdb\u884c\u4ea4\u4e92\u3002\u8fd9\u79cd\u65b9\u5f0f\u53ef\u4ee5\u5728\u9700\u8981\u7684\u65f6\u5019\u4f7f\u7528C\u8bed\u8a00\u7684\u9ad8\u6548\u7b97\u6cd5\uff0c\u4ece\u800c\u63d0\u5347\u6574\u4f53\u6027\u80fd\u3002<\/p>\n<p><strong>3\u3001\u5e76\u884c\u5904\u7406<\/strong><\/p>\n<p>Python\u63d0\u4f9b\u4e86\u591a\u7ebf\u7a0b\u548c\u591a\u8fdb\u7a0b\u7684\u652f\u6301\uff0c\u53ef\u4ee5\u5229\u7528\u591a\u6838\u5904\u7406\u5668\u7684\u5e76\u884c\u6027\u80fd\u3002\u901a\u8fc7\u5408\u7406\u5730\u4f7f\u7528\u7ebf\u7a0b\u6c60\u548c\u8fdb\u7a0b\u6c60\uff0c\u53ef\u4ee5\u5c06\u8ba1\u7b97\u5bc6\u96c6\u578b\u4efb\u52a1\u5206\u914d\u5230\u591a\u4e2a\u6838\u5fc3\u4e0a\uff0c\u5e76\u53d1\u5730\u6267\u884c\uff0c\u63d0\u9ad8\u7a0b\u5e8f\u7684\u6574\u4f53\u6548\u7387\u3002<\/p>\n<p><strong>4\u3001\u4f18\u5316\u7b97\u6cd5<\/strong><\/p>\n<p>\u6027\u80fd\u7684\u63d0\u5347\u4e0d\u4ec5\u4ec5\u4f9d\u8d56\u4e8e\u7f16\u7a0b\u8bed\u8a00\u672c\u8eab\uff0c\u8fd8\u4e0e\u7b97\u6cd5\u7684\u9009\u62e9\u6709\u5173\u3002Python\u793e\u533a\u4e2d\u6709\u8bb8\u591a\u9488\u5bf9\u7279\u5b9a\u95ee\u9898\u9886\u57df\u7684\u9ad8\u6027\u80fd\u5e93\uff0c\u5982NumPy\u548cPandas\uff0c\u5b83\u4eec\u901a\u8fc7\u4f7f\u7528\u9ad8\u6548\u7684\u7b97\u6cd5\u548c\u6570\u636e\u7ed3\u6784\uff0c\u5927\u5927\u63d0\u5347\u4e86\u76f8\u5173\u4efb\u52a1\u7684\u6267\u884c\u901f\u5ea6\u3002<\/p>\n<h2 class=\"wp-block-heading\">\u4e09\u3001Python\u7684\u9002\u7528\u573a\u666f<\/h2>\n<p>\u867d\u7136\uff0cPython\u5728\u4e00\u4e9b\u6027\u80fd\u5bc6\u96c6\u578b\u4efb\u52a1\u4e2d\u53ef\u80fd\u65e0\u6cd5\u4e0e\u7f16\u8bd1\u578b\u8bed\u8a00\u76f8\u5ab2\u7f8e\uff0c\u4f46\u5b83\u5728\u5176\u4ed6\u65b9\u9762\u7684\u4f18\u52bf\u4f7f\u5176\u6210\u4e3a\u8bb8\u591a\u9886\u57df\u7684\u4f18\u9009\u8bed\u8a00\uff0c\u5177\u4f53\u5305\u62ec\uff1a<\/p>\n<p><strong>1\u3001\u7f51\u7edc\u722c\u866b<\/strong><\/p>\n<p>Python\u5bf9\u4e8e\u7f16\u5199\u7f51\u7edc\u722c\u866b\u548c\u6570\u636e\u6293\u53d6\u7a0b\u5e8f\u6765\u8bf4\u662f\u4e00\u79cd\u975e\u5e38\u65b9\u4fbf\u7684\u8bed\u8a00\u3002\u5b83\u7684\u5e93\u5982BeautifulSoup\u548cScrapy\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u529f\u80fd\u6765\u89e3\u6790\u548c\u63d0\u53d6Web\u9875\u9762\u7684\u6570\u636e\u3002<\/p>\n<p><strong>2\u3001\u6570\u636e\u5206\u6790\u548c\u79d1\u5b66\u8ba1\u7b97<\/strong><\/p>\n<p>Python\u5728\u6570\u636e\u5206\u6790\u548c\u79d1\u5b66\u8ba1\u7b97\u9886\u57df\u4e2d\u5177\u6709\u5e7f\u6cdb\u7684\u5e94\u7528\u3002\u5b83\u62e5\u6709\u4e30\u5bcc\u7684\u7b2c\u4e09\u65b9\u5e93\uff0c\u5982NumPy\u3001SciPy\u548cPandas\uff0c\u63d0\u4f9b\u4e86\u9ad8\u6548\u7684\u6570\u636e\u7ed3\u6784\u548c\u7b97\u6cd5\uff0c\u4f7f\u5f97\u5904\u7406\u5927\u89c4\u6a21\u6570\u636e\u96c6\u53d8\u5f97\u9ad8\u6548\u800c\u7b80\u5355\u3002<\/p>\n<p><strong>3\u3001Web\u5f00\u53d1<\/strong><\/p>\n<p>Python\u62e5\u6709\u8bb8\u591a\u6210\u719f\u7684Web\u6846\u67b6\uff0c\u5982Django\u548cFlask\uff0c\u5b83\u4eec\u63d0\u4f9b\u4e86\u5feb\u901f\u6784\u5efa\u548c\u90e8\u7f72Web\u5e94\u7528\u7a0b\u5e8f\u7684\u80fd\u529b\u3002\u867d\u7136Python\u5728\u5904\u7406\u9ad8\u5e76\u53d1\u8bf7\u6c42\u65b9\u9762\u53ef\u80fd\u4e0d\u5982\u4e00\u4e9b\u5e95\u5c42\u8bed\u8a00\uff0c\u4f46\u5bf9\u4e8e\u4e2d\u5c0f\u578b\u5e94\u7528\u7a0b\u5e8f\u548c\u539f\u578b\u5f00\u53d1\u6765\u8bf4\uff0c\u5b83\u4ecd\u7136\u662f\u4e00\u4e2a\u5f3a\u5927\u800c\u9ad8\u6548\u7684\u9009\u62e9\u3002<\/p>\n<p><strong>4\u3001\u81ea\u52a8\u5316\u548c\u811a\u672c\u7f16\u5199<\/strong><\/p>\n<p>Python\u7684\u7b80\u6d01\u6027\u548c\u6613\u7528\u6027\u4f7f\u5176\u6210\u4e3a\u81ea\u52a8\u5316\u548c\u811a\u672c\u7f16\u5199\u7684\u4f18\u9009\u8bed\u8a00\u3002\u65e0\u8bba\u662f\u7cfb\u7edf\u7ba1\u7406\u3001\u6570\u636e\u5904\u7406\u8fd8\u662f\u4efb\u52a1\u81ea\u52a8\u5316\uff0cPython\u90fd\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u5e93\u548c\u5de5\u5177\uff0c\u4f7f\u5f97\u7f16\u5199\u53ef\u9760\u4e14\u9ad8\u6548\u7684\u811a\u672c\u53d8\u5f97\u5bb9\u6613\u3002<\/p>\n<p><strong>5\u3001\u6e38\u620f\u5f00\u53d1<\/strong><\/p>\n<p>Python\u53ef\u4ee5\u7528\u4e8e\u7f16\u5199\u7b80\u5355\u7684\u6e38\u620f\uff0c\u5c24\u5176\u9002\u5408\u5236\u4f5c\u5c0f\u578b\u6e38\u620f\u548c\u539f\u578b\u3002Pygame\u662f\u4e00\u4e2a\u6d41\u884c\u7684\u6e38\u620f\u5f00\u53d1\u5e93\uff0c\u63d0\u4f9b\u4e862D\u6e38\u620f\u5f00\u53d1\u6240\u9700\u7684\u5de5\u5177\u548c\u529f\u80fd\u3002<\/p>\n<p><strong>6\u3001\u6559\u80b2<\/strong><\/p>\n<p>Python\u6613\u5b66\u6613\u7528\u7684\u8bed\u6cd5\u4f7f\u5176\u6210\u4e3a\u7f16\u7a0b\u6559\u80b2\u7684\u7406\u60f3\u9009\u62e9\u3002\u8bb8\u591a\u5b66\u6821\u548c\u5927\u5b66\u90fd\u5c06Python\u4f5c\u4e3a\u4ed6\u4eec\u7684\u4f18\u9009\u7f16\u7a0b\u8bed\u8a00\u6765\u6559\u6388\u57fa\u7840\u7f16\u7a0b\u6982\u5ff5\u3002<\/p>\n<p>\u603b\u4f53\u800c\u8a00\uff0cPython\u5728\u67d0\u4e9b\u6027\u80fd\u654f\u611f\u7684\u9886\u57df\u53ef\u80fd\u4e0d\u662f\u4f18\u5f02\u9009\u62e9\uff0c\u6bd4\u5982\u9ad8\u6027\u80fd\u8ba1\u7b97\u548c\u5b9e\u65f6\u7cfb\u7edf\uff0c\u56e0\u4e3a\u5b83\u662f\u4e00\u79cd\u89e3\u91ca\u578b\u8bed\u8a00\u3002\u5728\u8fd9\u4e9b\u60c5\u51b5\u4e0b\uff0c\u66f4\u9002\u5408\u4f7f\u7528C\u3001C++\u6216\u5176\u4ed6\u7f16\u8bd1\u578b\u8bed\u8a00\u3002\u7136\u800c\uff0cPython\u53ef\u4ee5\u4e0e\u8fd9\u4e9b\u8bed\u8a00\u96c6\u6210\uff0c\u901a\u8fc7\u4f7f\u7528\u6269\u5c55\u6a21\u5757\u548c\u8c03\u7528\u5916\u90e8\u5e93\u6765\u63d0\u9ad8\u6027\u80fd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Python\u5728\u6027\u80fd\u65b9\u9762\u4f1a\u5b58\u5728\u4e00\u4e9b\u9650\u5236\uff0c\u7279\u522b\u662f\u5728\u5bf9\u901f\u5ea6\u8981\u6c42\u6781\u9ad8\u7684\u9886\u57df\u3002\u4f46\u901a\u8fc7\u4f7f\u7528\u7f16\u8bd1\u5668\u3001\u4f18\u5316\u7b97\u6cd5\u3001\u5e76\u884c\u5904\u7406\u7b49\u6280\u672f [&hellip;]","protected":false},"author":1,"featured_media":34385,"comment_status":"closed","ping_status":"open","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\/34384"}],"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\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=34384"}],"version-history":[{"count":0,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/34384\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/34385"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=34384"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=34384"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=34384"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}