{"id":1023973,"date":"2024-12-30T14:09:37","date_gmt":"2024-12-30T06:09:37","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1023973.html"},"modified":"2024-12-30T14:09:39","modified_gmt":"2024-12-30T06:09:39","slug":"%e7%bc%96%e5%86%99%e7%9a%84python%e5%a6%82%e4%bd%95%e6%89%93%e5%bc%80-2","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1023973.html","title":{"rendered":"\u7f16\u5199\u7684python\u5982\u4f55\u6253\u5f00"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-docs.pingcode.com\/wp-content\/uploads\/2024\/12\/7e100667-5c55-4d52-ba54-efb511f8e10e.webp?x-oss-process=image\/auto-orient,1\/format,webp\" alt=\"\u7f16\u5199\u7684python\u5982\u4f55\u6253\u5f00\" \/><\/p>\n<p><h3>\u4e00\u3001\u4f7f\u7528IDLE\u6216Python Shell\u6253\u5f00Python\u6587\u4ef6<\/h3>\n<\/p>\n<p><p><strong>Python IDLE\uff08Integrated Development and Learning Environment\uff09<\/strong> \u662fPython\u9ed8\u8ba4\u7684\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff0c\u5b83\u5305\u542b\u4e86\u4e00\u4e2a\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668\u548c\u4e00\u4e2a\u7b80\u5355\u7684\u4ee3\u7801\u7f16\u8f91\u5668\u3002<strong>\u4f60\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u6b65\u9aa4\u4f7f\u7528IDLE\u6253\u5f00Python\u6587\u4ef6\uff1a<\/strong><\/p>\n<\/p>\n<ol>\n<li>\u5b89\u88c5Python\uff1a\u786e\u4fdd\u4f60\u5df2\u7ecf\u5728\u8ba1\u7b97\u673a\u4e0a\u5b89\u88c5\u4e86Python\u3002\u5982\u679c\u4f60\u8fd8\u6ca1\u6709\u5b89\u88c5\uff0c\u53ef\u4ee5\u8bbf\u95ee<a href=\"https:\/\/www.python.org\/\">Python\u5b98\u65b9\u7f51\u7ad9<\/a>\u4e0b\u8f7d\u5e76\u5b89\u88c5\u6700\u65b0\u7248\u672c\u7684Python\u3002<\/li>\n<li>\u6253\u5f00IDLE\uff1a\u5728\u5b89\u88c5Python\u65f6\uff0cIDLE\u901a\u5e38\u4f1a\u4e00\u8d77\u5b89\u88c5\u3002\u4f60\u53ef\u4ee5\u5728\u5f00\u59cb\u83dc\u5355\u6216\u5e94\u7528\u5217\u8868\u4e2d\u627e\u5230\u5e76\u542f\u52a8IDLE\u3002<\/li>\n<li>\u6253\u5f00Python\u6587\u4ef6\uff1a\u5728IDLE\u4e2d\uff0c\u70b9\u51fb\u83dc\u5355\u680f\u7684\u201cFile\u201d\uff08\u6587\u4ef6\uff09\u9009\u9879\uff0c\u7136\u540e\u9009\u62e9\u201cOpen\u201d\uff08\u6253\u5f00\uff09\u3002\u6d4f\u89c8\u5230\u4f60\u5b58\u50a8Python\u6587\u4ef6\u7684\u76ee\u5f55\uff0c\u9009\u62e9\u6587\u4ef6\u5e76\u70b9\u51fb\u201cOpen\u201d\u6309\u94ae\u3002<\/li>\n<\/ol>\n<p><p>\u8be6\u7ec6\u63cf\u8ff0\uff1aIDLE\u4e0d\u4ec5\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u7f16\u8f91\u5668\uff0c\u5b83\u8fd8\u5305\u542b\u4e86\u4e00\u4e2a\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668\u3002\u5728IDLE\u4e2d\uff0c\u4f60\u53ef\u4ee5\u76f4\u63a5\u8fd0\u884cPython\u4ee3\u7801\u5e76\u7acb\u5373\u770b\u5230\u7ed3\u679c\uff0c\u8fd9\u5bf9\u4e8e\u8c03\u8bd5\u548c\u6d4b\u8bd5\u4ee3\u7801\u975e\u5e38\u6709\u7528\u3002IDLE\u8fd8\u63d0\u4f9b\u4e86\u4e00\u4e9b\u57fa\u672c\u7684\u4ee3\u7801\u8865\u5168\u548c\u8bed\u6cd5\u9ad8\u4eae\u529f\u80fd\uff0c\u53ef\u4ee5\u5e2e\u52a9\u4f60\u66f4\u9ad8\u6548\u5730\u7f16\u5199\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><h3>\u4e8c\u3001\u4f7f\u7528\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u6253\u5f00Python\u6587\u4ef6<\/h3>\n<\/p>\n<p><p><strong>\u901a\u8fc7\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u8fd0\u884cPython\u6587\u4ef6<\/strong> \u662f\u53e6\u4e00\u79cd\u5e38\u89c1\u7684\u65b9\u6cd5\u3002<strong>\u5177\u4f53\u6b65\u9aa4\u5982\u4e0b\uff1a<\/strong><\/p>\n<\/p>\n<ol>\n<li>\u6253\u5f00\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\uff1a\u5728Windows\u7cfb\u7edf\u4e2d\uff0c\u4f60\u53ef\u4ee5\u6309\u4e0b\u201cWin+R\u201d\u952e\uff0c\u8f93\u5165\u201ccmd\u201d\u5e76\u56de\u8f66\uff1b\u5728macOS\u6216Linux\u7cfb\u7edf\u4e2d\uff0c\u4f60\u53ef\u4ee5\u6253\u5f00\u201cTerminal\u201d\u5e94\u7528\u3002<\/li>\n<li>\u5bfc\u822a\u5230Python\u6587\u4ef6\u6240\u5728\u7684\u76ee\u5f55\uff1a\u4f7f\u7528<code>cd<\/code>\u547d\u4ee4\uff08change directory\uff09\u5bfc\u822a\u5230\u5b58\u50a8Python\u6587\u4ef6\u7684\u76ee\u5f55\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4f60\u7684\u6587\u4ef6\u4f4d\u4e8e\u201cC:\\Users\\YourName\\Documents\u201d\u76ee\u5f55\u4e0b\uff0c\u4f60\u53ef\u4ee5\u8f93\u5165<code>cd C:\\Users\\YourName\\Documents<\/code>\u5e76\u6309\u56de\u8f66\u3002<\/li>\n<li>\u8fd0\u884cPython\u6587\u4ef6\uff1a\u8f93\u5165<code>python filename.py<\/code>\u5e76\u6309\u56de\u8f66\uff0c\u5176\u4e2d<code>filename.py<\/code>\u662f\u4f60\u7684Python\u6587\u4ef6\u7684\u540d\u79f0\u3002<\/li>\n<\/ol>\n<p><p>\u8be6\u7ec6\u63cf\u8ff0\uff1a\u4f7f\u7528\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u8fd0\u884cPython\u6587\u4ef6\u662f\u4e00\u79cd\u975e\u5e38\u76f4\u63a5\u7684\u65b9\u5f0f\uff0c\u7279\u522b\u9002\u5408\u90a3\u4e9b\u5df2\u7ecf\u719f\u6089\u547d\u4ee4\u884c\u64cd\u4f5c\u7684\u7528\u6237\u3002\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u4f60\u53ef\u4ee5\u5feb\u901f\u6267\u884cPython\u811a\u672c\uff0c\u5e76\u4e14\u53ef\u4ee5\u65b9\u4fbf\u5730\u4f20\u9012\u547d\u4ee4\u884c\u53c2\u6570\u3002\u6b64\u5916\uff0c\u4f7f\u7528\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u8fd8\u53ef\u4ee5\u66f4\u597d\u5730\u4e0e\u5176\u4ed6\u547d\u4ee4\u884c\u5de5\u5177\u548c\u811a\u672c\u8fdb\u884c\u96c6\u6210\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u4f7f\u7528\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u6253\u5f00Python\u6587\u4ef6<\/h3>\n<\/p>\n<p><p><strong>\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09<\/strong> \u662f\u4e13\u95e8\u4e3a\u8f6f\u4ef6\u5f00\u53d1\u8bbe\u8ba1\u7684\u5de5\u5177\uff0c\u901a\u5e38\u5305\u542b\u4ee3\u7801\u7f16\u8f91\u3001\u8c03\u8bd5\u3001\u7248\u672c\u63a7\u5236\u7b49\u529f\u80fd\u3002<strong>\u4e00\u4e9b\u6d41\u884c\u7684Python IDE\u5305\u62ecPyCharm\u3001Visual Studio Code\u548cJupyter Notebook\u3002<\/strong><\/p>\n<\/p>\n<p><h4>1. PyCharm<\/h4>\n<\/p>\n<p><p>PyCharm\u662fJetBr<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>ns\u516c\u53f8\u5f00\u53d1\u7684\u4e00\u6b3e\u529f\u80fd\u5f3a\u5927\u7684Python IDE\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528PyCharm\u6253\u5f00Python\u6587\u4ef6\u7684\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u5b89\u88c5PyCharm\uff1a\u8bbf\u95ee<a href=\"https:\/\/www.jetbrains.com\/pycharm\/\">PyCharm\u5b98\u65b9\u7f51\u7ad9<\/a>\u4e0b\u8f7d\u5e76\u5b89\u88c5PyCharm\u3002<\/li>\n<li>\u6253\u5f00PyCharm\uff1a\u542f\u52a8PyCharm\u5e94\u7528\u7a0b\u5e8f\u3002<\/li>\n<li>\u5bfc\u5165\u9879\u76ee\u6216\u6253\u5f00\u6587\u4ef6\uff1a\u5728PyCharm\u7684\u6b22\u8fce\u754c\u9762\uff0c\u4f60\u53ef\u4ee5\u9009\u62e9\u201cOpen\u201d\uff08\u6253\u5f00\uff09\u9009\u9879\uff0c\u7136\u540e\u6d4f\u89c8\u5230\u5b58\u50a8Python\u6587\u4ef6\u7684\u76ee\u5f55\uff0c\u9009\u62e9\u6587\u4ef6\u5e76\u70b9\u51fb\u201cOK\u201d\u6309\u94ae\u3002<\/li>\n<\/ol>\n<p><p>\u8be6\u7ec6\u63cf\u8ff0\uff1aPyCharm\u63d0\u4f9b\u4e86\u8bb8\u591a\u9ad8\u7ea7\u529f\u80fd\uff0c\u5982\u4ee3\u7801\u8865\u5168\u3001\u4ee3\u7801\u91cd\u6784\u3001\u8c03\u8bd5\u3001\u5355\u5143\u6d4b\u8bd5\u7b49\uff0c\u8fd9\u4e9b\u529f\u80fd\u53ef\u4ee5\u663e\u8457\u63d0\u9ad8\u4f60\u7684\u5f00\u53d1\u6548\u7387\u3002PyCharm\u8fd8\u652f\u6301\u591a\u79cd\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff08\u5982Git\u3001SVN\uff09\uff0c\u4fbf\u4e8e\u56e2\u961f\u534f\u4f5c\u3002<\/p>\n<\/p>\n<p><h4>2. Visual Studio Code<\/h4>\n<\/p>\n<p><p>Visual Studio Code\uff08VS Code\uff09\u662f\u5fae\u8f6f\u5f00\u53d1\u7684\u4e00\u6b3e\u514d\u8d39\u5f00\u6e90\u7684\u4ee3\u7801\u7f16\u8f91\u5668\uff0c\u5e7f\u6cdb\u652f\u6301\u591a\u79cd\u7f16\u7a0b\u8bed\u8a00\uff0c\u5305\u62ecPython\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528VS Code\u6253\u5f00Python\u6587\u4ef6\u7684\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u5b89\u88c5VS Code\uff1a\u8bbf\u95ee<a href=\"https:\/\/code.visualstudio.com\/\">Visual Studio Code\u5b98\u65b9\u7f51\u7ad9<\/a>\u4e0b\u8f7d\u5e76\u5b89\u88c5VS Code\u3002<\/li>\n<li>\u5b89\u88c5Python\u6269\u5c55\uff1a\u5728VS Code\u4e2d\uff0c\u70b9\u51fb\u6269\u5c55\u56fe\u6807\uff08\u5de6\u4fa7\u680f\u7684\u7b2c\u56db\u4e2a\u56fe\u6807\uff09\uff0c\u641c\u7d22\u201cPython\u201d\u5e76\u5b89\u88c5\u5b98\u65b9\u7684Python\u6269\u5c55\u3002<\/li>\n<li>\u6253\u5f00Python\u6587\u4ef6\uff1a\u70b9\u51fb\u201cFile\u201d\uff08\u6587\u4ef6\uff09\u83dc\u5355\uff0c\u9009\u62e9\u201cOpen File\u201d\uff08\u6253\u5f00\u6587\u4ef6\uff09\uff0c\u6d4f\u89c8\u5230\u5b58\u50a8Python\u6587\u4ef6\u7684\u76ee\u5f55\uff0c\u9009\u62e9\u6587\u4ef6\u5e76\u70b9\u51fb\u201cOpen\u201d\u6309\u94ae\u3002<\/li>\n<\/ol>\n<p><p>\u8be6\u7ec6\u63cf\u8ff0\uff1aVS Code\u5177\u6709\u5f3a\u5927\u7684\u6269\u5c55\u529f\u80fd\uff0c\u7528\u6237\u53ef\u4ee5\u6839\u636e\u9700\u8981\u5b89\u88c5\u5404\u79cd\u6269\u5c55\u63d2\u4ef6\u6765\u589e\u5f3a\u7f16\u8f91\u5668\u7684\u529f\u80fd\u3002Python\u6269\u5c55\u63d0\u4f9b\u4e86\u4ee3\u7801\u8865\u5168\u3001\u8c03\u8bd5\u3001Linting\u7b49\u529f\u80fd\uff0c\u53ef\u4ee5\u5e2e\u52a9\u4f60\u66f4\u9ad8\u6548\u5730\u7f16\u5199\u548c\u8c03\u8bd5Python\u4ee3\u7801\u3002VS Code\u8fd8\u652f\u6301\u96c6\u6210\u7ec8\u7aef\uff0c\u53ef\u4ee5\u5728\u7f16\u8f91\u5668\u4e2d\u76f4\u63a5\u8fd0\u884cPython\u811a\u672c\u3002<\/p>\n<\/p>\n<p><h4>3. Jupyter Notebook<\/h4>\n<\/p>\n<p><p>Jupyter Notebook\u662f\u4e00\u79cd\u57fa\u4e8eWeb\u7684\u4ea4\u4e92\u5f0f\u5f00\u53d1\u73af\u5883\uff0c\u7279\u522b\u9002\u5408\u6570\u636e\u79d1\u5b66\u548c<a href=\"https:\/\/docs.pingcode.com\/ask\/59192.html\" target=\"_blank\">\u673a\u5668\u5b66\u4e60<\/a>\u9879\u76ee\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528Jupyter Notebook\u6253\u5f00Python\u6587\u4ef6\u7684\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u5b89\u88c5Jupyter Notebook\uff1a\u4f60\u53ef\u4ee5\u4f7f\u7528<code>pip<\/code>\u547d\u4ee4\u5b89\u88c5Jupyter Notebook\u3002\u6253\u5f00\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\uff0c\u8f93\u5165<code>pip install notebook<\/code>\u5e76\u6309\u56de\u8f66\u3002<\/li>\n<li>\u542f\u52a8Jupyter Notebook\uff1a\u5728\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u4e2d\uff0c\u8f93\u5165<code>jupyter notebook<\/code>\u5e76\u6309\u56de\u8f66\u3002Jupyter Notebook\u4f1a\u5728\u9ed8\u8ba4\u6d4f\u89c8\u5668\u4e2d\u542f\u52a8\u3002<\/li>\n<li>\u6253\u5f00Python\u6587\u4ef6\uff1a\u5728Jupyter Notebook\u7684\u754c\u9762\u4e2d\uff0c\u6d4f\u89c8\u5230\u5b58\u50a8Python\u6587\u4ef6\u7684\u76ee\u5f55\uff0c\u70b9\u51fb\u6587\u4ef6\u540d\u5373\u53ef\u6253\u5f00\u3002<\/li>\n<\/ol>\n<p><p>\u8be6\u7ec6\u63cf\u8ff0\uff1aJupyter Notebook\u975e\u5e38\u9002\u5408\u7528\u4e8e\u6570\u636e\u63a2\u7d22\u3001\u6570\u636e\u53ef\u89c6\u5316\u548c\u5171\u4eab\u53ef\u91cd\u590d\u7684\u5206\u6790\u3002\u4f60\u53ef\u4ee5\u5728Notebook\u4e2d\u7f16\u5199Markdown\u6587\u6863\u3001\u63d2\u5165\u4ee3\u7801\u5355\u5143\u683c\u3001\u8fd0\u884c\u4ee3\u7801\u5e76\u7acb\u5373\u770b\u5230\u7ed3\u679c\u3002Notebook\u8fd8\u652f\u6301\u4e30\u5bcc\u7684\u4ea4\u4e92\u5f0f\u8f93\u51fa\uff0c\u5982\u56fe\u8868\u548c\u8868\u683c\uff0c\u975e\u5e38\u9002\u5408\u6570\u636e\u79d1\u5b66\u5bb6\u548c\u7814\u7a76\u4eba\u5458\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u4f7f\u7528\u5728\u7ebfPython\u7f16\u8bd1\u5668\u6253\u5f00Python\u6587\u4ef6<\/h3>\n<\/p>\n<p><p><strong>\u5728\u7ebfPython\u7f16\u8bd1\u5668<\/strong> \u662f\u4e00\u79cd\u65e0\u9700\u5b89\u88c5\u4efb\u4f55\u8f6f\u4ef6\u5373\u53ef\u5728\u6d4f\u89c8\u5668\u4e2d\u8fd0\u884cPython\u4ee3\u7801\u7684\u5de5\u5177\uff0c\u975e\u5e38\u9002\u5408\u5feb\u901f\u6d4b\u8bd5\u548c\u5206\u4eab\u4ee3\u7801\u3002<strong>\u4e00\u4e9b\u6d41\u884c\u7684\u5728\u7ebfPython\u7f16\u8bd1\u5668\u5305\u62ecRepl.it\u3001Google Colab\u548cOnlineGDB\u3002<\/strong><\/p>\n<\/p>\n<p><h4>1. Repl.it<\/h4>\n<\/p>\n<p><p>Repl.it\u662f\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u7684\u5728\u7ebf\u7f16\u7a0b\u73af\u5883\uff0c\u652f\u6301\u591a\u79cd\u7f16\u7a0b\u8bed\u8a00\uff0c\u5305\u62ecPython\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528Repl.it\u6253\u5f00Python\u6587\u4ef6\u7684\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u8bbf\u95eeRepl.it\uff1a\u6253\u5f00\u6d4f\u89c8\u5668\uff0c\u8bbf\u95ee<a href=\"https:\/\/repl.it\/\">Repl.it\u5b98\u65b9\u7f51\u7ad9<\/a>\u3002<\/li>\n<li>\u767b\u5f55\u6216\u6ce8\u518c\uff1a\u5982\u679c\u4f60\u6ca1\u6709Repl.it\u8d26\u53f7\uff0c\u53ef\u4ee5\u4f7f\u7528Google\u6216GitHub\u8d26\u53f7\u6ce8\u518c\u5e76\u767b\u5f55\u3002<\/li>\n<li>\u521b\u5efa\u65b0\u7684Repl\uff1a\u70b9\u51fb\u201cCreate Repl\u201d\u6309\u94ae\uff0c\u9009\u62e9\u201cPython\u201d\u4f5c\u4e3a\u8bed\u8a00\uff0c\u7136\u540e\u70b9\u51fb\u201cCreate Repl\u201d\u6309\u94ae\u3002<\/li>\n<li>\u6253\u5f00Python\u6587\u4ef6\uff1a\u4f60\u53ef\u4ee5\u901a\u8fc7\u62d6\u653e\u6587\u4ef6\u6216\u70b9\u51fb\u6587\u4ef6\u56fe\u6807\u6765\u4e0a\u4f20Python\u6587\u4ef6\u3002<\/li>\n<\/ol>\n<p><p>\u8be6\u7ec6\u63cf\u8ff0\uff1aRepl.it\u4e0d\u4ec5\u63d0\u4f9b\u4e86\u4ee3\u7801\u7f16\u8f91\u548c\u8fd0\u884c\u73af\u5883\uff0c\u8fd8\u652f\u6301\u5b9e\u65f6\u534f\u4f5c\u548c\u5206\u4eab\u4ee3\u7801\u3002\u4f60\u53ef\u4ee5\u9080\u8bf7\u5176\u4ed6\u7528\u6237\u4e00\u8d77\u7f16\u8f91\u548c\u8fd0\u884c\u4ee3\u7801\uff0c\u975e\u5e38\u9002\u5408\u6559\u5b66\u548c\u56e2\u961f\u9879\u76ee\u3002<\/p>\n<\/p>\n<p><h4>2. Google Colab<\/h4>\n<\/p>\n<p><p>Google Colab\u662f\u8c37\u6b4c\u63d0\u4f9b\u7684\u4e00\u4e2a\u514d\u8d39\u7684\u5728\u7ebfJupyter Notebook\u73af\u5883\uff0c\u7279\u522b\u9002\u5408\u673a\u5668\u5b66\u4e60\u548c\u6570\u636e\u79d1\u5b66\u9879\u76ee\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528Google Colab\u6253\u5f00Python\u6587\u4ef6\u7684\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u8bbf\u95eeGoogle Colab\uff1a\u6253\u5f00\u6d4f\u89c8\u5668\uff0c\u8bbf\u95ee<a href=\"https:\/\/colab.research.google.com\/\">Google Colab\u5b98\u65b9\u7f51\u7ad9<\/a>\u3002<\/li>\n<li>\u767b\u5f55Google\u8d26\u53f7\uff1a\u5982\u679c\u4f60\u6ca1\u6709Google\u8d26\u53f7\uff0c\u9700\u8981\u6ce8\u518c\u5e76\u767b\u5f55\u3002<\/li>\n<li>\u521b\u5efa\u65b0\u7684Notebook\uff1a\u70b9\u51fb\u201cNew Notebook\u201d\u6309\u94ae\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Notebook\u3002<\/li>\n<li>\u6253\u5f00Python\u6587\u4ef6\uff1a\u70b9\u51fb\u6587\u4ef6\u83dc\u5355\uff0c\u9009\u62e9\u201cUpload notebook\u201d\u9009\u9879\uff0c\u6d4f\u89c8\u5e76\u9009\u62e9\u4f60\u7684Python\u6587\u4ef6\u3002<\/li>\n<\/ol>\n<p><p>\u8be6\u7ec6\u63cf\u8ff0\uff1aGoogle Colab\u63d0\u4f9b\u4e86\u514d\u8d39\u7684GPU\u548cTPU\u652f\u6301\uff0c\u975e\u5e38\u9002\u5408\u8bad\u7ec3\u6df1\u5ea6\u5b66\u4e60\u6a21\u578b\u3002Colab\u8fd8\u96c6\u6210\u4e86Google Drive\uff0c\u4fbf\u4e8e\u5b58\u50a8\u548c\u5206\u4eabNotebook\u6587\u4ef6\u3002\u4f60\u53ef\u4ee5\u5728Colab\u4e2d\u7f16\u5199\u3001\u8fd0\u884c\u548c\u5206\u4eab\u4ee3\u7801\uff0c\u975e\u5e38\u9002\u5408\u6570\u636e\u79d1\u5b66\u5bb6\u548c\u7814\u7a76\u4eba\u5458\u3002<\/p>\n<\/p>\n<p><h4>3. OnlineGDB<\/h4>\n<\/p>\n<p><p>OnlineGDB\u662f\u4e00\u4e2a\u652f\u6301\u591a\u79cd\u7f16\u7a0b\u8bed\u8a00\u7684\u5728\u7ebf\u7f16\u8bd1\u5668\u548c\u8c03\u8bd5\u5668\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528OnlineGDB\u6253\u5f00Python\u6587\u4ef6\u7684\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u8bbf\u95eeOnlineGDB\uff1a\u6253\u5f00\u6d4f\u89c8\u5668\uff0c\u8bbf\u95ee<a href=\"https:\/\/www.onlinegdb.com\/\">OnlineGDB\u5b98\u65b9\u7f51\u7ad9<\/a>\u3002<\/li>\n<li>\u9009\u62e9Python\u8bed\u8a00\uff1a\u5728\u4e3b\u9875\u4e0a\uff0c\u70b9\u51fb\u8bed\u8a00\u9009\u62e9\u4e0b\u62c9\u83dc\u5355\uff0c\u9009\u62e9\u201cPython\u201d\u3002<\/li>\n<li>\u6253\u5f00Python\u6587\u4ef6\uff1a\u70b9\u51fb\u6587\u4ef6\u56fe\u6807\uff0c\u9009\u62e9\u201cUpload File\u201d\u9009\u9879\uff0c\u6d4f\u89c8\u5e76\u9009\u62e9\u4f60\u7684Python\u6587\u4ef6\u3002<\/li>\n<\/ol>\n<p><p>\u8be6\u7ec6\u63cf\u8ff0\uff1aOnlineGDB\u4e0d\u4ec5\u652f\u6301\u4ee3\u7801\u7f16\u8f91\u548c\u8fd0\u884c\uff0c\u8fd8\u63d0\u4f9b\u4e86\u8c03\u8bd5\u529f\u80fd\u3002\u4f60\u53ef\u4ee5\u8bbe\u7f6e\u65ad\u70b9\u3001\u5355\u6b65\u6267\u884c\u4ee3\u7801\u548c\u67e5\u770b\u53d8\u91cf\u503c\uff0c\u975e\u5e38\u9002\u5408\u8c03\u8bd5\u548c\u5b66\u4e60\u7f16\u7a0b\u3002<\/p>\n<\/p>\n<p><h3>\u4e94\u3001\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\u6253\u5f00Python\u6587\u4ef6<\/h3>\n<\/p>\n<p><p><strong>\u6587\u672c\u7f16\u8f91\u5668<\/strong> \u662f\u4e00\u79cd\u8f7b\u91cf\u7ea7\u7684\u4ee3\u7801\u7f16\u8f91\u5de5\u5177\uff0c\u9002\u5408\u5feb\u901f\u7f16\u8f91\u548c\u67e5\u770b\u4ee3\u7801\u3002<strong>\u4e00\u4e9b\u6d41\u884c\u7684\u6587\u672c\u7f16\u8f91\u5668\u5305\u62ecNotepad++\u3001Sublime Text\u548cAtom\u3002<\/strong><\/p>\n<\/p>\n<p><h4>1. Notepad++<\/h4>\n<\/p>\n<p><p>Notepad++\u662f\u4e00\u4e2a\u514d\u8d39\u5f00\u6e90\u7684\u6587\u672c\u7f16\u8f91\u5668\uff0c\u652f\u6301\u591a\u79cd\u7f16\u7a0b\u8bed\u8a00\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528Notepad++\u6253\u5f00Python\u6587\u4ef6\u7684\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u5b89\u88c5Notepad++\uff1a\u8bbf\u95ee<a href=\"https:\/\/notepad-plus-plus.org\/\">Notepad++\u5b98\u65b9\u7f51\u7ad9<\/a>\u4e0b\u8f7d\u5e76\u5b89\u88c5Notepad++\u3002<\/li>\n<li>\u6253\u5f00Notepad++\uff1a\u542f\u52a8Notepad++\u5e94\u7528\u7a0b\u5e8f\u3002<\/li>\n<li>\u6253\u5f00Python\u6587\u4ef6\uff1a\u70b9\u51fb\u201cFile\u201d\u83dc\u5355\uff0c\u9009\u62e9\u201cOpen\u201d\u9009\u9879\uff0c\u6d4f\u89c8\u5230\u5b58\u50a8Python\u6587\u4ef6\u7684\u76ee\u5f55\uff0c\u9009\u62e9\u6587\u4ef6\u5e76\u70b9\u51fb\u201cOpen\u201d\u6309\u94ae\u3002<\/li>\n<\/ol>\n<p><p>\u8be6\u7ec6\u63cf\u8ff0\uff1aNotepad++\u63d0\u4f9b\u4e86\u8bed\u6cd5\u9ad8\u4eae\u3001\u4ee3\u7801\u6298\u53e0\u548c\u63d2\u4ef6\u652f\u6301\u7b49\u529f\u80fd\uff0c\u53ef\u4ee5\u663e\u8457\u63d0\u9ad8\u4ee3\u7801\u7f16\u8f91\u6548\u7387\u3002\u867d\u7136Notepad++\u6ca1\u6709\u96c6\u6210\u7684\u8fd0\u884c\u73af\u5883\uff0c\u4f46\u4f60\u53ef\u4ee5\u7ed3\u5408\u547d\u4ee4\u884c\u4f7f\u7528\uff0c\u975e\u5e38\u9002\u5408\u5feb\u901f\u7f16\u8f91\u548c\u67e5\u770b\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><h4>2. Sublime Text<\/h4>\n<\/p>\n<p><p>Sublime Text\u662f\u4e00\u6b3e\u529f\u80fd\u5f3a\u5927\u7684\u4ee3\u7801\u7f16\u8f91\u5668\uff0c\u5e7f\u6cdb\u652f\u6301\u591a\u79cd\u7f16\u7a0b\u8bed\u8a00\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528Sublime Text\u6253\u5f00Python\u6587\u4ef6\u7684\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u5b89\u88c5Sublime Text\uff1a\u8bbf\u95ee<a href=\"https:\/\/www.sublimetext.com\/\">Sublime Text\u5b98\u65b9\u7f51\u7ad9<\/a>\u4e0b\u8f7d\u5e76\u5b89\u88c5Sublime Text\u3002<\/li>\n<li>\u6253\u5f00Sublime Text\uff1a\u542f\u52a8Sublime Text\u5e94\u7528\u7a0b\u5e8f\u3002<\/li>\n<li>\u6253\u5f00Python\u6587\u4ef6\uff1a\u70b9\u51fb\u201cFile\u201d\u83dc\u5355\uff0c\u9009\u62e9\u201cOpen File\u201d\u9009\u9879\uff0c\u6d4f\u89c8\u5230\u5b58\u50a8Python\u6587\u4ef6\u7684\u76ee\u5f55\uff0c\u9009\u62e9\u6587\u4ef6\u5e76\u70b9\u51fb\u201cOpen\u201d\u6309\u94ae\u3002<\/li>\n<\/ol>\n<p><p>\u8be6\u7ec6\u63cf\u8ff0\uff1aSublime Text\u5177\u6709\u4f18\u96c5\u7684\u7528\u6237\u754c\u9762\u548c\u4e30\u5bcc\u7684\u529f\u80fd\uff0c\u5982\u591a\u5149\u6807\u7f16\u8f91\u3001\u547d\u4ee4\u9762\u677f\u548c\u63d2\u4ef6\u652f\u6301\u3002\u4f60\u53ef\u4ee5\u6839\u636e\u9700\u8981\u5b89\u88c5\u5404\u79cd\u63d2\u4ef6\u6765\u589e\u5f3a\u7f16\u8f91\u5668\u7684\u529f\u80fd\uff0c\u5982\u4ee3\u7801\u8865\u5168\u3001Linting\u548c\u7248\u672c\u63a7\u5236\u7b49\u3002<\/p>\n<\/p>\n<p><h4>3. Atom<\/h4>\n<\/p>\n<p><p>Atom\u662fGitHub\u5f00\u53d1\u7684\u4e00\u6b3e\u514d\u8d39\u5f00\u6e90\u7684\u4ee3\u7801\u7f16\u8f91\u5668\uff0c\u5e7f\u6cdb\u652f\u6301\u591a\u79cd\u7f16\u7a0b\u8bed\u8a00\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528Atom\u6253\u5f00Python\u6587\u4ef6\u7684\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u5b89\u88c5Atom\uff1a\u8bbf\u95ee<a href=\"https:\/\/atom.io\/\">Atom\u5b98\u65b9\u7f51\u7ad9<\/a>\u4e0b\u8f7d\u5e76\u5b89\u88c5Atom\u3002<\/li>\n<li>\u6253\u5f00Atom\uff1a\u542f\u52a8Atom\u5e94\u7528\u7a0b\u5e8f\u3002<\/li>\n<li>\u6253\u5f00Python\u6587\u4ef6\uff1a\u70b9\u51fb\u201cFile\u201d\u83dc\u5355\uff0c\u9009\u62e9\u201cOpen File\u201d\u9009\u9879\uff0c\u6d4f\u89c8\u5230\u5b58\u50a8Python\u6587\u4ef6\u7684\u76ee\u5f55\uff0c\u9009\u62e9\u6587\u4ef6\u5e76\u70b9\u51fb\u201cOpen\u201d\u6309\u94ae\u3002<\/li>\n<\/ol>\n<p><p>\u8be6\u7ec6\u63cf\u8ff0\uff1aAtom\u5177\u6709\u9ad8\u5ea6\u53ef\u5b9a\u5236\u7684\u7528\u6237\u754c\u9762\u548c\u4e30\u5bcc\u7684\u63d2\u4ef6\u652f\u6301\u3002\u4f60\u53ef\u4ee5\u6839\u636e\u9700\u8981\u5b89\u88c5\u5404\u79cd\u63d2\u4ef6\u6765\u589e\u5f3a\u7f16\u8f91\u5668\u7684\u529f\u80fd\uff0c\u5982\u4ee3\u7801\u8865\u5168\u3001Linting\u548c\u7248\u672c\u63a7\u5236\u7b49\u3002Atom\u8fd8\u652f\u6301Git\u96c6\u6210\uff0c\u975e\u5e38\u9002\u5408\u4e0eGitHub\u4e00\u8d77\u4f7f\u7528\u3002<\/p>\n<\/p>\n<p><h3>\u516d\u3001\u4f7f\u7528Python\u865a\u62df\u73af\u5883\u8fd0\u884cPython\u6587\u4ef6<\/h3>\n<\/p>\n<p><p><strong>Python\u865a\u62df\u73af\u5883<\/strong> \u662f\u4e00\u79cd\u9694\u79bb\u7684Python\u73af\u5883\uff0c\u5141\u8bb8\u4f60\u5728\u540c\u4e00\u53f0\u673a\u5668\u4e0a\u5b89\u88c5\u548c\u7ba1\u7406\u591a\u4e2aPython\u7248\u672c\u548c\u5305\u3002<strong>\u4f7f\u7528\u865a\u62df\u73af\u5883\u53ef\u4ee5\u907f\u514d\u5305\u7248\u672c\u51b2\u7a81\uff0c\u786e\u4fdd\u9879\u76ee\u7684\u53ef\u91cd\u590d\u6027\u3002<\/strong><\/p>\n<\/p>\n<p><h4>1. \u521b\u5efa\u865a\u62df\u73af\u5883<\/h4>\n<\/p>\n<p><p>\u4f60\u53ef\u4ee5\u4f7f\u7528<code>venv<\/code>\u6a21\u5757\u521b\u5efa\u865a\u62df\u73af\u5883\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u6253\u5f00\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u3002<\/li>\n<li>\u5bfc\u822a\u5230\u4f60\u7684\u9879\u76ee\u76ee\u5f55\uff1a\u4f7f\u7528<code>cd<\/code>\u547d\u4ee4\u5bfc\u822a\u5230\u5b58\u50a8Python\u6587\u4ef6\u7684\u76ee\u5f55\u3002<\/li>\n<li>\u521b\u5efa\u865a\u62df\u73af\u5883\uff1a\u8f93\u5165<code>python -m venv env<\/code>\u5e76\u6309\u56de\u8f66\uff0c\u5176\u4e2d<code>env<\/code>\u662f\u865a\u62df\u73af\u5883\u7684\u540d\u79f0\u3002<\/li>\n<\/ol>\n<p><p>\u8be6\u7ec6\u63cf\u8ff0\uff1a<code>venv<\/code>\u6a21\u5757\u662fPython\u6807\u51c6\u5e93\u7684\u4e00\u90e8\u5206\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u521b\u5efa\u548c\u7ba1\u7406\u865a\u62df\u73af\u5883\u3002\u865a\u62df\u73af\u5883\u5305\u542b\u4e86\u72ec\u7acb\u7684Python\u89e3\u91ca\u5668\u548c\u5305\u7ba1\u7406\u5668\uff0c\u53ef\u4ee5\u5728\u5176\u4e2d\u5b89\u88c5\u548c\u7ba1\u7406\u7279\u5b9a\u9879\u76ee\u6240\u9700\u7684\u5305\u548c\u4f9d\u8d56\u9879\u3002<\/p>\n<\/p>\n<p><h4>2. \u6fc0\u6d3b\u865a\u62df\u73af\u5883<\/h4>\n<\/p>\n<p><p>\u6fc0\u6d3b\u865a\u62df\u73af\u5883\u53ef\u4ee5\u8ba9\u4f60\u5728\u865a\u62df\u73af\u5883\u4e2d\u8fd0\u884cPython\u4ee3\u7801\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u5728Windows\u7cfb\u7edf\u4e2d\uff0c\u8f93\u5165<code>env\\Scripts\\activate<\/code>\u5e76\u6309\u56de\u8f66\u3002<\/li>\n<li>\u5728macOS\u6216Linux\u7cfb\u7edf\u4e2d\uff0c\u8f93\u5165<code>source env\/bin\/activate<\/code>\u5e76\u6309\u56de\u8f66\u3002<\/li>\n<\/ol>\n<p><p>\u8be6\u7ec6\u63cf\u8ff0\uff1a\u6fc0\u6d3b\u865a\u62df\u73af\u5883\u540e\uff0c\u547d\u4ee4\u884c\u63d0\u793a\u7b26\u4f1a\u663e\u793a\u865a\u62df\u73af\u5883\u7684\u540d\u79f0\uff0c\u8868\u793a\u4f60\u5df2\u7ecf\u8fdb\u5165\u4e86\u865a\u62df\u73af\u5883\u3002\u4f60\u53ef\u4ee5\u5728\u865a\u62df\u73af\u5883\u4e2d\u5b89\u88c5\u548c\u7ba1\u7406\u5305\uff0c\u5e76\u5728\u5176\u4e2d\u8fd0\u884cPython\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><h4>3. \u8fd0\u884cPython\u6587\u4ef6<\/h4>\n<\/p>\n<p><p>\u5728\u865a\u62df\u73af\u5883\u4e2d\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528<code>python<\/code>\u547d\u4ee4\u8fd0\u884cPython\u6587\u4ef6\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u786e\u4fdd\u865a\u62df\u73af\u5883\u5df2\u7ecf\u6fc0\u6d3b\u3002<\/li>\n<li>\u5bfc\u822a\u5230Python\u6587\u4ef6\u6240\u5728\u7684\u76ee\u5f55\u3002<\/li>\n<li>\u8f93\u5165<code>python filename.py<\/code>\u5e76\u6309\u56de\u8f66\uff0c\u5176\u4e2d<code>filename.py<\/code>\u662f\u4f60\u7684Python\u6587\u4ef6\u7684\u540d\u79f0\u3002<\/li>\n<\/ol>\n<p><p>\u8be6\u7ec6\u63cf\u8ff0\uff1a\u5728\u865a\u62df\u73af\u5883\u4e2d\u8fd0\u884cPython\u6587\u4ef6\u53ef\u4ee5\u786e\u4fdd\u4f7f\u7528\u7279\u5b9a\u9879\u76ee\u6240\u9700\u7684Python\u7248\u672c\u548c\u5305\u7248\u672c\uff0c\u907f\u514d\u4e0e\u7cfb\u7edf\u5168\u5c40\u73af\u5883\u53d1\u751f\u51b2\u7a81\u3002\u8fd9\u5bf9\u4e8e\u5f00\u53d1\u548c\u90e8\u7f72Python\u9879\u76ee\u975e\u5e38\u91cd\u8981\u3002<\/p>\n<\/p>\n<p><h3>\u4e03\u3001\u4f7f\u7528\u4e91\u5e73\u53f0\u8fd0\u884cPython\u6587\u4ef6<\/h3>\n<\/p>\n<p><p><strong>\u4e91\u5e73\u53f0<\/strong> \u63d0\u4f9b\u4e86\u57fa\u4e8eWeb\u7684\u5f00\u53d1\u548c\u8fd0\u884c\u73af\u5883\uff0c\u5141\u8bb8\u4f60\u5728\u4e91\u7aef\u8fd0\u884cPython\u4ee3\u7801\u3002<strong>\u4e00\u4e9b\u6d41\u884c\u7684\u4e91\u5e73\u53f0\u5305\u62ecAWS Lambda\u3001Google Cloud Functions\u548cAzure Functions\u3002<\/strong><\/p>\n<\/p>\n<p><h4>1. AWS Lambda<\/h4>\n<\/p>\n<p><p>AWS Lambda\u662f\u4e9a\u9a6c\u900a\u63d0\u4f9b\u7684\u4e00\u79cd\u65e0\u670d\u52a1\u5668\u8ba1\u7b97\u670d\u52a1\uff0c\u5141\u8bb8\u4f60\u5728\u4e91\u7aef\u8fd0\u884c\u4ee3\u7801\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528AWS Lambda\u8fd0\u884cPython\u6587\u4ef6\u7684\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u767b\u5f55AWS\u63a7\u5236\u53f0\uff1a\u8bbf\u95ee<a href=\"https:\/\/aws.amazon.com\/\">AWS\u63a7\u5236\u53f0<\/a>\u5e76\u767b\u5f55\u4f60\u7684AWS\u8d26\u53f7\u3002<\/li>\n<li>\u521b\u5efaLambda\u51fd\u6570\uff1a\u5728Lambda\u670d\u52a1\u9875\u9762\uff0c\u70b9\u51fb\u201cCreate function\u201d\u6309\u94ae\uff0c\u9009\u62e9\u201cAuthor from scratch\u201d\u9009\u9879\uff0c\u8f93\u5165\u51fd\u6570\u540d\u79f0\uff0c\u9009\u62e9\u8fd0\u884c\u65f6\u4e3aPython\uff0c\u7136\u540e\u70b9\u51fb\u201cCreate function\u201d\u6309\u94ae\u3002<\/li>\n<li>\u4e0a\u4f20Python\u6587\u4ef6\uff1a\u5728\u51fd\u6570\u914d\u7f6e\u9875\u9762\uff0c\u70b9\u51fb\u201cUpload from\u201d\u4e0b\u62c9\u83dc\u5355\uff0c\u9009\u62e9\u201c.zip file\u201d\u9009\u9879\uff0c\u4e0a\u4f20\u5305\u542bPython\u6587\u4ef6\u7684ZIP\u538b\u7f29\u5305\u3002<\/li>\n<li>\u914d\u7f6e\u89e6\u53d1\u5668\uff1a\u6839\u636e\u9700\u8981\u914d\u7f6e\u89e6\u53d1\u5668\uff0c\u5982API Gateway\u3001S3\u7b49\u3002<\/li>\n<\/ol>\n<p><p>\u8be6\u7ec6\u63cf\u8ff0\uff1aAWS Lambda\u5141\u8bb8\u4f60\u5728\u4e91\u7aef\u8fd0\u884cPython\u4ee3\u7801\uff0c\u5e76\u6309\u9700\u6269\u5c55\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7\u914d\u7f6e\u4e0d\u540c\u7684\u89e6\u53d1\u5668\u6765\u81ea\u52a8\u5316\u4efb\u52a1\uff0c\u5982\u5904\u7406S3\u6587\u4ef6\u3001\u54cd\u5e94API\u8bf7\u6c42\u7b49\u3002Lambda\u51fd\u6570\u6309\u4f7f\u7528\u91cf\u8ba1\u8d39\uff0c\u975e\u5e38\u9002\u5408\u4e8b\u4ef6\u9a71\u52a8\u7684\u5e94\u7528\u573a\u666f\u3002<\/p>\n<\/p>\n<p><h4>2. Google Cloud Functions<\/h4>\n<\/p>\n<p><p>Google Cloud Functions\u662f\u8c37\u6b4c\u63d0\u4f9b\u7684\u4e00\u79cd\u65e0\u670d\u52a1\u5668\u8ba1\u7b97\u670d\u52a1\uff0c\u5141\u8bb8\u4f60\u5728\u4e91\u7aef\u8fd0\u884c\u4ee3\u7801\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528Google Cloud Functions\u8fd0\u884cPython\u6587\u4ef6\u7684\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u767b\u5f55Google Cloud\u63a7\u5236\u53f0\uff1a\u8bbf\u95ee<a href=\"https:\/\/cloud.google.com\/\">Google Cloud\u63a7\u5236\u53f0<\/a>\u5e76\u767b\u5f55\u4f60\u7684Google\u8d26\u53f7\u3002<\/li>\n<li>\u521b\u5efa\u51fd\u6570\uff1a\u5728Cloud Functions\u670d\u52a1\u9875\u9762\uff0c\u70b9\u51fb\u201cCreate function\u201d\u6309\u94ae\uff0c\u8f93\u5165\u51fd\u6570\u540d\u79f0\uff0c\u9009\u62e9\u8fd0\u884c\u65f6\u4e3aPython\uff0c\u7136\u540e\u70b9\u51fb\u201cNext\u201d\u6309\u94ae\u3002<\/li>\n<li>\u4e0a\u4f20Python\u6587\u4ef6\uff1a\u5728\u4ee3\u7801\u7f16\u8f91\u9875\u9762\uff0c\u4f60\u53ef\u4ee5\u76f4\u63a5\u7f16\u8f91\u4ee3\u7801\u6216\u4e0a\u4f20\u5305\u542bPython\u6587\u4ef6\u7684ZIP\u538b\u7f29\u5305\u3002<\/li>\n<li>\u914d\u7f6e\u89e6\u53d1\u5668\uff1a\u6839\u636e\u9700\u8981\u914d\u7f6e\u89e6\u53d1\u5668\uff0c\u5982HTTP\u3001Pub\/Sub\u7b49\u3002<\/li>\n<\/ol>\n<p><p>\u8be6\u7ec6\u63cf\u8ff0\uff1aGoogle Cloud Functions\u5141\u8bb8\u4f60\u5728\u4e91\u7aef\u8fd0\u884cPython\u4ee3\u7801\uff0c\u5e76\u6309\u9700\u6269\u5c55\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7\u914d\u7f6e\u4e0d\u540c\u7684\u89e6\u53d1\u5668\u6765\u81ea\u52a8\u5316\u4efb\u52a1\uff0c\u5982\u5904\u7406HTTP\u8bf7\u6c42\u3001\u54cd\u5e94Pub\/Sub\u6d88\u606f\u7b49\u3002Cloud Functions\u6309\u4f7f\u7528\u91cf\u8ba1\u8d39\uff0c\u975e\u5e38\u9002\u5408\u4e8b\u4ef6\u9a71\u52a8\u7684\u5e94\u7528\u573a\u666f\u3002<\/p>\n<\/p>\n<p><h4>3. Azure Functions<\/h4>\n<\/p>\n<p><p>Azure Functions\u662f\u5fae\u8f6f\u63d0\u4f9b\u7684\u4e00\u79cd\u65e0\u670d\u52a1\u5668\u8ba1\u7b97\u670d\u52a1\uff0c\u5141\u8bb8\u4f60\u5728\u4e91\u7aef\u8fd0\u884c\u4ee3\u7801\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528Azure Functions\u8fd0\u884cPython\u6587\u4ef6\u7684\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u767b\u5f55Azure\u95e8\u6237\uff1a\u8bbf\u95ee<a href=\"https:\/\/portal.azure.com\/\">Azure\u95e8\u6237<\/a>\u5e76\u767b\u5f55\u4f60\u7684Azure\u8d26\u53f7\u3002<\/li>\n<li>\u521b\u5efa\u51fd\u6570\u5e94\u7528\uff1a\u5728\u51fd\u6570\u5e94\u7528\u670d\u52a1\u9875\u9762\uff0c\u70b9\u51fb\u201cAdd\u201d\u6309\u94ae\uff0c\u8f93\u5165\u5e94\u7528\u540d\u79f0\uff0c\u9009\u62e9\u8fd0\u884c\u65f6\u4e3aPython\uff0c\u7136\u540e\u70b9\u51fb\u201cCreate\u201d\u6309\u94ae\u3002<\/li>\n<li>\u521b\u5efa\u51fd\u6570\uff1a\u5728\u51fd\u6570\u5e94\u7528\u9875\u9762\uff0c\u70b9\u51fb\u201cFunctions\u201d\u9009\u9879\uff0c\u9009\u62e9\u201cNew function\u201d\u6309\u94ae\uff0c\u9009\u62e9\u89e6\u53d1\u5668\u7c7b\u578b\uff0c\u5982HTTP Trigger\u3002<\/li>\n<li>\u4e0a\u4f20Python\u6587\u4ef6\uff1a\u5728\u4ee3\u7801\u7f16\u8f91\u9875\u9762\uff0c\u4f60\u53ef\u4ee5\u76f4\u63a5\u7f16\u8f91\u4ee3\u7801\u6216\u4e0a\u4f20\u5305\u542bPython\u6587\u4ef6\u7684ZIP\u538b\u7f29\u5305\u3002<\/li>\n<\/ol>\n<p><p>\u8be6\u7ec6\u63cf\u8ff0\uff1aAzure Functions\u5141\u8bb8\u4f60\u5728\u4e91\u7aef\u8fd0\u884cPython\u4ee3\u7801\uff0c\u5e76\u6309\u9700\u6269\u5c55\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7\u914d\u7f6e\u4e0d\u540c\u7684\u89e6\u53d1\u5668\u6765\u81ea\u52a8\u5316\u4efb\u52a1\uff0c\u5982\u5904\u7406HTTP\u8bf7\u6c42\u3001\u54cd\u5e94\u4e8b\u4ef6\u7f51\u683c\u6d88\u606f\u7b49\u3002Functions\u6309\u4f7f\u7528\u91cf\u8ba1\u8d39\uff0c\u975e\u5e38\u9002\u5408\u4e8b\u4ef6\u9a71\u52a8\u7684\u5e94\u7528\u573a\u666f\u3002<\/p>\n<\/p>\n<p><h3>\u516b\u3001\u4f7f\u7528Docker\u5bb9\u5668\u8fd0\u884cPython\u6587\u4ef6<\/h3>\n<\/p>\n<p><p><strong>Docker\u5bb9\u5668<\/strong> \u662f\u4e00\u79cd\u8f7b\u91cf\u7ea7\u7684\u865a\u62df\u5316\u6280\u672f\uff0c\u5141\u8bb8\u4f60\u5728\u9694\u79bb\u7684\u73af\u5883\u4e2d\u8fd0\u884cPython\u4ee3\u7801\u3002<strong>\u4f7f\u7528Docker\u5bb9\u5668\u53ef\u4ee5\u786e\u4fdd\u4ee3\u7801\u5728\u4e0d\u540c\u73af\u5883\u4e2d\u7684\u4e00\u81f4\u6027\u3002<\/strong><\/p>\n<\/p>\n<p><h4>1. \u521b\u5efaDockerfile<\/h4>\n<\/p>\n<p><p>\u9996\u5148\uff0c\u4f60\u9700\u8981\u521b\u5efa\u4e00\u4e2aDockerfile\u6765\u5b9a\u4e49\u5bb9\u5668\u73af\u5883\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-Dockerfile\"># \u4f7f\u7528\u5b98\u65b9Python\u955c\u50cf<\/p>\n<p>FROM python:3.9-slim<\/p>\n<h2><strong>\u8bbe\u7f6e\u5de5\u4f5c\u76ee\u5f55<\/strong><\/h2>\n<p>WORKDIR \/app<\/p>\n<h2><strong>\u590d\u5236\u5f53\u524d\u76ee\u5f55\u7684\u5185\u5bb9\u5230\u5bb9\u5668\u4e2d<\/strong><\/h2>\n<p>COPY . \/app<\/p>\n<h2><strong>\u5b89\u88c5\u4f9d\u8d56\u5305<\/strong><\/h2>\n<p>RUN pip install -r requirements.txt<\/p>\n<h2><strong>\u8fd0\u884cPython\u6587\u4ef6<\/strong><\/h2>\n<p>CMD [&quot;python&quot;, &quot;filename.py&quot;]<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8be6\u7ec6\u63cf\u8ff0\uff1aDockerfile\u662f\u4e00\u4e2a\u6587\u672c\u6587\u4ef6\uff0c\u5305\u542b\u4e86\u6784\u5efaDocker\u955c\u50cf\u7684\u6307\u4ee4\u3002\u4f60\u53ef\u4ee5\u5728Dockerfile\u4e2d\u6307\u5b9a\u57fa\u7840\u955c\u50cf\u3001\u5de5\u4f5c\u76ee\u5f55\u3001\u4f9d\u8d56\u5305<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728\u6211\u7684\u8ba1\u7b97\u673a\u4e0a\u5b89\u88c5Python\uff1f<\/strong><br \/>\u5728\u60a8\u7684\u8ba1\u7b97\u673a\u4e0a\u5b89\u88c5Python\u76f8\u5bf9\u7b80\u5355\u3002\u60a8\u53ef\u4ee5\u8bbf\u95eePython\u5b98\u65b9\u7f51\u7ad9\uff08python.org\uff09\uff0c\u4e0b\u8f7d\u9002\u5408\u60a8\u64cd\u4f5c\u7cfb\u7edf\u7684\u5b89\u88c5\u7a0b\u5e8f\u3002\u5b89\u88c5\u8fc7\u7a0b\u4e2d\uff0c\u786e\u4fdd\u52fe\u9009\u201cAdd Python to PATH\u201d\u9009\u9879\uff0c\u4ee5\u4fbf\u5728\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u76f4\u63a5\u4f7f\u7528Python\u547d\u4ee4\u3002<\/p>\n<p><strong>\u7f16\u5199Python\u4ee3\u7801\u9700\u8981\u4ec0\u4e48\u6837\u7684\u6587\u672c\u7f16\u8f91\u5668\u6216IDE\uff1f<\/strong><br \/>\u60a8\u53ef\u4ee5\u4f7f\u7528\u591a\u79cd\u6587\u672c\u7f16\u8f91\u5668\u6216\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u6765\u7f16\u5199Python\u4ee3\u7801\u3002\u5e38\u89c1\u7684\u9009\u62e9\u5305\u62ecVisual Studio Code\u3001PyCharm\u3001Sublime Text\u548cJupyter Notebook\u3002\u6bcf\u79cd\u5de5\u5177\u90fd\u6709\u5176\u72ec\u7279\u7684\u529f\u80fd\uff0c\u60a8\u53ef\u4ee5\u6839\u636e\u4e2a\u4eba\u504f\u597d\u548c\u9879\u76ee\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u5de5\u5177\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728Python\u4e2d\u8fd0\u884c\u6211\u7f16\u5199\u7684\u4ee3\u7801\uff1f<\/strong><br \/>\u4e00\u65e6\u60a8\u7f16\u5199\u4e86Python\u4ee3\u7801\uff0c\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u6765\u8fd0\u884c\u3002\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\u6216\u7ec8\u7aef\uff0c\u5bfc\u822a\u5230\u5305\u542b\u60a8\u4ee3\u7801\u6587\u4ef6\u7684\u76ee\u5f55\uff0c\u7136\u540e\u8f93\u5165<code>python your_file_name.py<\/code>\u6765\u6267\u884c\u4ee3\u7801\u3002\u5982\u679c\u60a8\u4f7f\u7528\u7684\u662f\u67d0\u4e9bIDE\uff0c\u5219\u53ef\u4ee5\u76f4\u63a5\u5728IDE\u4e2d\u70b9\u51fb\u201c\u8fd0\u884c\u201d\u6309\u94ae\u6765\u6267\u884c\u7a0b\u5e8f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u4e00\u3001\u4f7f\u7528IDLE\u6216Python Shell\u6253\u5f00Python\u6587\u4ef6 Python IDLE\uff08Integrated [&hellip;]","protected":false},"author":3,"featured_media":1023977,"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\/1023973"}],"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=1023973"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1023973\/revisions"}],"predecessor-version":[{"id":1023978,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1023973\/revisions\/1023978"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1023977"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1023973"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1023973"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1023973"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}