{"id":1163281,"date":"2025-01-15T14:53:25","date_gmt":"2025-01-15T06:53:25","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1163281.html"},"modified":"2025-01-15T14:53:31","modified_gmt":"2025-01-15T06:53:31","slug":"%e5%a6%82%e4%bd%95%e6%96%b0%e5%bb%bapython%e7%bc%96%e8%be%91%e5%99%a8","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1163281.html","title":{"rendered":"\u5982\u4f55\u65b0\u5efapython\u7f16\u8f91\u5668"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25204104\/937507ba-7bbb-4f9b-ad75-273974057db9.webp\" alt=\"\u5982\u4f55\u65b0\u5efapython\u7f16\u8f91\u5668\" \/><\/p>\n<p><p> <strong>\u65b0\u5efaPython\u7f16\u8f91\u5668\u7684\u65b9\u6cd5\u5305\u62ec\uff1a\u9009\u62e9\u4e00\u4e2aIDE\u3001\u5b89\u88c5Python\u3001\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u3001\u5b89\u88c5\u5fc5\u8981\u7684\u5e93\u548c\u63d2\u4ef6\u3001\u7f16\u5199\u548c\u8fd0\u884c\u4ee3\u7801\u3002<\/strong>\u5176\u4e2d\uff0c\u9009\u62e9\u4e00\u4e2a\u9002\u5408\u7684IDE\uff08\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff09\u662f\u5173\u952e\u7684\u4e00\u6b65\u3002IDE\u80fd\u591f\u63d0\u4f9b\u4ee3\u7801\u9ad8\u4eae\u3001\u81ea\u52a8\u8865\u5168\u3001\u8c03\u8bd5\u529f\u80fd\u7b49\uff0c\u6781\u5927\u63d0\u5347\u5f00\u53d1\u6548\u7387\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u63cf\u8ff0\u5404\u4e2a\u6b65\u9aa4\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u9009\u62e9\u4e00\u4e2aIDE<\/h3>\n<\/p>\n<p><p>\u9009\u62e9\u4e00\u4e2a\u9002\u5408\u7684IDE\u662f\u65b0\u5efaPython\u7f16\u8f91\u5668\u7684\u7b2c\u4e00\u6b65\u3002\u5e38\u89c1\u7684Python IDE\u6709PyCharm\u3001VS Code\u3001Jupyter Notebook\u3001Spyder\u7b49\u3002\u6bcf\u79cdIDE\u90fd\u6709\u5176\u4f18\u7f3a\u70b9\u548c\u9002\u7528\u573a\u666f\u3002<\/p>\n<\/p>\n<p><h4>1. PyCharm<\/h4>\n<\/p>\n<p><p>PyCharm\u662f\u7531JetBr<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\u5b83\u63d0\u4f9b\u4e86\u5f88\u591a\u9ad8\u7ea7\u529f\u80fd\uff0c\u5982\u667a\u80fd\u4ee3\u7801\u8865\u5168\u3001\u4ee3\u7801\u5bfc\u822a\u3001\u8c03\u8bd5\u3001\u5355\u5143\u6d4b\u8bd5\u3001\u7248\u672c\u63a7\u5236\u96c6\u6210\u7b49\u3002<\/p>\n<\/p>\n<ul>\n<li>\n<p><strong>\u4f18\u70b9<\/strong>\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u5f3a\u5927\u7684\u4ee3\u7801\u8865\u5168\u548c\u5bfc\u822a\u529f\u80fd\u3002<\/li>\n<li>\u5185\u7f6e\u8c03\u8bd5\u5668\u548c\u5355\u5143\u6d4b\u8bd5\u5de5\u5177\u3002<\/li>\n<li>\u652f\u6301\u591a\u79cd\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff08\u5982Git\u3001SVN\u7b49\uff09\u3002<\/li>\n<li>\u652f\u6301Web\u5f00\u53d1\uff08\u5982Django\u3001Flask\u7b49\uff09\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u7f3a\u70b9<\/strong>\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u7a0b\u5e8f\u8f83\u5927\uff0c\u5360\u7528\u8d44\u6e90\u8f83\u591a\u3002<\/li>\n<li>\u4e13\u4e1a\u7248\u9700\u8981\u4ed8\u8d39\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><h4>2. VS Code<\/h4>\n<\/p>\n<p><p>Visual Studio Code\uff08VS Code\uff09\u662f\u7531\u5fae\u8f6f\u5f00\u53d1\u7684\u4e00\u6b3e\u514d\u8d39\u5f00\u6e90\u7684\u4ee3\u7801\u7f16\u8f91\u5668\u3002\u901a\u8fc7\u5b89\u88c5\u6269\u5c55\uff0c\u53ef\u4ee5\u975e\u5e38\u65b9\u4fbf\u5730\u652f\u6301Python\u5f00\u53d1\u3002<\/p>\n<\/p>\n<ul>\n<li>\n<p><strong>\u4f18\u70b9<\/strong>\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u514d\u8d39\u5f00\u6e90\uff0c\u793e\u533a\u652f\u6301\u5f3a\u5927\u3002<\/li>\n<li>\u8f7b\u91cf\u7ea7\uff0c\u542f\u52a8\u901f\u5ea6\u5feb\u3002<\/li>\n<li>\u4e30\u5bcc\u7684\u63d2\u4ef6\u652f\u6301\uff0c\u53ef\u4ee5\u6839\u636e\u9700\u6c42\u5b9a\u5236\u529f\u80fd\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u7f3a\u70b9<\/strong>\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u9700\u8981\u624b\u52a8\u5b89\u88c5\u548c\u914d\u7f6e\u63d2\u4ef6\u3002<\/li>\n<li>\u90e8\u5206\u9ad8\u7ea7\u529f\u80fd\u9700\u8981\u5b89\u88c5\u989d\u5916\u7684\u63d2\u4ef6\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><h4>3. Jupyter Notebook<\/h4>\n<\/p>\n<p><p>Jupyter Notebook\u662f\u4e00\u6b3e\u57fa\u4e8eWeb\u7684\u4ea4\u4e92\u5f0f\u8ba1\u7b97\u73af\u5883\uff0c\u975e\u5e38\u9002\u5408\u6570\u636e\u79d1\u5b66\u548c<a href=\"https:\/\/docs.pingcode.com\/ask\/59192.html\" target=\"_blank\">\u673a\u5668\u5b66\u4e60<\/a>\u9886\u57df\u7684\u5f00\u53d1\u3002<\/p>\n<\/p>\n<ul>\n<li>\n<p><strong>\u4f18\u70b9<\/strong>\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u652f\u6301\u4ea4\u4e92\u5f0f\u8ba1\u7b97\uff0c\u53ef\u4ee5\u5373\u65f6\u67e5\u770b\u4ee3\u7801\u8fd0\u884c\u7ed3\u679c\u3002<\/li>\n<li>\u4e30\u5bcc\u7684\u53ef\u89c6\u5316\u5de5\u5177\uff0c\u9002\u5408\u6570\u636e\u5206\u6790\u548c\u53ef\u89c6\u5316\u3002<\/li>\n<li>\u652f\u6301Markdown\uff0c\u65b9\u4fbf\u7f16\u5199\u6587\u6863\u548c\u6ce8\u91ca\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u7f3a\u70b9<\/strong>\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u4e0d\u9002\u5408\u5927\u578b\u9879\u76ee\u7684\u5f00\u53d1\u3002<\/li>\n<li>\u8c03\u8bd5\u529f\u80fd\u8f83\u5f31\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><h4>4. Spyder<\/h4>\n<\/p>\n<p><p>Spyder\u662f\u4e00\u6b3e\u4e13\u95e8\u4e3a\u6570\u636e\u79d1\u5b66\u5bb6\u548c\u5de5\u7a0b\u5e08\u8bbe\u8ba1\u7684Python IDE\uff0c\u96c6\u6210\u4e86\u4ee3\u7801\u7f16\u8f91\u3001\u8c03\u8bd5\u3001\u6570\u636e\u5206\u6790\u7b49\u529f\u80fd\u3002<\/p>\n<\/p>\n<ul>\n<li>\n<p><strong>\u4f18\u70b9<\/strong>\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u4e13\u4e3a\u6570\u636e\u79d1\u5b66\u8bbe\u8ba1\uff0c\u96c6\u6210\u4e86\u5f88\u591a\u6570\u636e\u5206\u6790\u5de5\u5177\u3002<\/li>\n<li>\u652f\u6301\u79d1\u5b66\u8ba1\u7b97\u5e93\uff08\u5982NumPy\u3001SciPy\u3001Pandas\u7b49\uff09\u3002<\/li>\n<li>\u5185\u7f6e\u4ea4\u4e92\u5f0f\u63a7\u5236\u53f0\uff0c\u65b9\u4fbf\u8c03\u8bd5\u548c\u6d4b\u8bd5\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u7f3a\u70b9<\/strong>\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u754c\u9762\u4e0d\u591f\u73b0\u4ee3\u5316\u3002<\/li>\n<li>\u5bf9\u5927\u578b\u9879\u76ee\u652f\u6301\u4e0d\u591f\u53cb\u597d\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><h3>\u4e8c\u3001\u5b89\u88c5Python<\/h3>\n<\/p>\n<p><p>\u9009\u62e9\u597dIDE\u540e\uff0c\u63a5\u4e0b\u6765\u9700\u8981\u5b89\u88c5Python\u89e3\u91ca\u5668\u3002\u53ef\u4ee5\u4ecePython\u5b98\u7f51\uff08<a href=\"https:\/\/www.python.org\/%EF%BC%89%E4%B8%8B%E8%BD%BD%E6%9C%80%E6%96%B0%E7%9A%84Python%E7%89%88%E6%9C%AC%E3%80%82%E5%AE%89%E8%A3%85%E8%BF%87%E7%A8%8B%E4%B8%AD%E5%BB%BA%E8%AE%AE%E5%8B%BE%E9%80%89%E2%80%9CAdd\">https:\/\/www.python.org\/\uff09\u4e0b\u8f7d\u6700\u65b0\u7684Python\u7248\u672c\u3002\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u5efa\u8bae\u52fe\u9009\u201cAdd<\/a> Python to PATH\u201d\u9009\u9879\uff0c\u8fd9\u6837\u53ef\u4ee5\u81ea\u52a8\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u3002<\/p>\n<\/p>\n<p><h3>\u4e09\u3001\u914d\u7f6e\u73af\u5883\u53d8\u91cf<\/h3>\n<\/p>\n<p><p>\u5728Windows\u7cfb\u7edf\u4e0b\uff0c\u5982\u679c\u6ca1\u6709\u5728\u5b89\u88c5Python\u65f6\u52fe\u9009\u201cAdd Python to PATH\u201d\uff0c\u9700\u8981\u624b\u52a8\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u3002\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u53f3\u952e\u70b9\u51fb\u201c\u6b64\u7535\u8111\u201d\u56fe\u6807\uff0c\u9009\u62e9\u201c\u5c5e\u6027\u201d\u3002<\/li>\n<li>\u5728\u5f39\u51fa\u7684\u7a97\u53e3\u4e2d\uff0c\u70b9\u51fb\u201c\u9ad8\u7ea7\u7cfb\u7edf\u8bbe\u7f6e\u201d\u3002<\/li>\n<li>\u5728\u201c\u7cfb\u7edf\u5c5e\u6027\u201d\u7a97\u53e3\u4e2d\uff0c\u70b9\u51fb\u201c\u73af\u5883\u53d8\u91cf\u201d\u6309\u94ae\u3002<\/li>\n<li>\u5728\u201c\u73af\u5883\u53d8\u91cf\u201d\u7a97\u53e3\u4e2d\uff0c\u627e\u5230\u201c\u7cfb\u7edf\u53d8\u91cf\u201d\u90e8\u5206\uff0c\u53cc\u51fb\u201cPath\u201d\u53d8\u91cf\u3002<\/li>\n<li>\u5728\u5f39\u51fa\u7684\u7a97\u53e3\u4e2d\uff0c\u70b9\u51fb\u201c\u65b0\u5efa\u201d\uff0c\u7136\u540e\u8f93\u5165Python\u5b89\u88c5\u8def\u5f84\uff08\u5982C:\\Python39\\\uff09\uff0c\u70b9\u51fb\u201c\u786e\u5b9a\u201d\u4fdd\u5b58\u3002<\/li>\n<\/ol>\n<p><h3>\u56db\u3001\u5b89\u88c5\u5fc5\u8981\u7684\u5e93\u548c\u63d2\u4ef6<\/h3>\n<\/p>\n<p><p>\u6839\u636e\u9879\u76ee\u9700\u6c42\uff0c\u5b89\u88c5\u5fc5\u8981\u7684Python\u5e93\u548cIDE\u63d2\u4ef6\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<ul>\n<li>\n<p><strong>\u5e38\u7528Python\u5e93<\/strong>\uff1a<\/p>\n<\/p>\n<ul>\n<li>NumPy\uff1a\u7528\u4e8e\u79d1\u5b66\u8ba1\u7b97\u3002<\/li>\n<li>Pandas\uff1a\u7528\u4e8e\u6570\u636e\u5904\u7406\u548c\u5206\u6790\u3002<\/li>\n<li>Matplotlib\uff1a\u7528\u4e8e\u6570\u636e\u53ef\u89c6\u5316\u3002<\/li>\n<li>Requests\uff1a\u7528\u4e8e\u7f51\u7edc\u8bf7\u6c42\u3002<\/li>\n<li>Flask\/Django\uff1a\u7528\u4e8eWeb\u5f00\u53d1\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>IDE\u63d2\u4ef6<\/strong>\uff1a<\/p>\n<\/p>\n<ul>\n<li>VS Code\uff1aPython\u63d2\u4ef6\u3001Pylint\u3001Jupyter\u7b49\u3002<\/li>\n<li>PyCharm\uff1aPython Scientific\u3001Database Navigator\u7b49\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><h3>\u4e94\u3001\u7f16\u5199\u548c\u8fd0\u884c\u4ee3\u7801<\/h3>\n<\/p>\n<p><p>\u5b8c\u6210\u4e0a\u8ff0\u6b65\u9aa4\u540e\uff0c\u5c31\u53ef\u4ee5\u5f00\u59cb\u7f16\u5199\u548c\u8fd0\u884cPython\u4ee3\u7801\u4e86\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\u4ee3\u7801\uff0c\u6f14\u793a\u5982\u4f55\u4f7f\u7528Python\u8fdb\u884c\u57fa\u672c\u7684\u8ba1\u7b97\u548c\u6253\u5370\u8f93\u51fa\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># \u793a\u4f8b\u4ee3\u7801\uff1a\u8ba1\u7b97\u4e24\u4e2a\u6570\u7684\u548c<\/p>\n<p>def add_numbers(a, b):<\/p>\n<p>    return a + b<\/p>\n<h2><strong>\u4e3b\u51fd\u6570<\/strong><\/h2>\n<p>if __name__ == &quot;__main__&quot;:<\/p>\n<p>    num1 = 10<\/p>\n<p>    num2 = 20<\/p>\n<p>    result = add_numbers(num1, num2)<\/p>\n<p>    print(f&quot;The sum of {num1} and {num2} is {result}&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd0\u884c\u4e0a\u8ff0\u4ee3\u7801\uff0cIDE\u4f1a\u8f93\u51fa\u7ed3\u679c\uff1a\u201cThe sum of 10 and 20 is 30\u201d\u3002<\/p>\n<\/p>\n<p><h3>\u516d\u3001\u8c03\u8bd5\u548c\u4f18\u5316\u4ee3\u7801<\/h3>\n<\/p>\n<p><p>\u5728\u5f00\u53d1\u8fc7\u7a0b\u4e2d\uff0c\u8c03\u8bd5\u548c\u4f18\u5316\u4ee3\u7801\u662f\u4e0d\u53ef\u907f\u514d\u7684\u3002\u5229\u7528IDE\u63d0\u4f9b\u7684\u8c03\u8bd5\u5de5\u5177\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u65ad\u70b9\u3001\u5355\u6b65\u6267\u884c\u3001\u67e5\u770b\u53d8\u91cf\u503c\u7b49\uff0c\u5e2e\u52a9\u5feb\u901f\u5b9a\u4f4d\u548c\u89e3\u51b3\u95ee\u9898\u3002<\/p>\n<\/p>\n<p><h3>\u4e03\u3001\u7248\u672c\u63a7\u5236<\/h3>\n<\/p>\n<p><p>\u4f7f\u7528\u7248\u672c\u63a7\u5236\u7cfb\u7edf\uff08\u5982Git\uff09\u53ef\u4ee5\u65b9\u4fbf\u5730\u7ba1\u7406\u4ee3\u7801\u7248\u672c\uff0c\u8ddf\u8e2a\u4ee3\u7801\u53d8\u66f4\uff0c\u534f\u4f5c\u5f00\u53d1\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684Git\u4f7f\u7528\u793a\u4f8b\uff1a<\/p>\n<\/p>\n<ol>\n<li>\u521d\u59cb\u5316Git\u4ed3\u5e93\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-sh\">git init<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li>\u6dfb\u52a0\u6587\u4ef6\u5230\u6682\u5b58\u533a\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-sh\">git add .<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"3\">\n<li>\u63d0\u4ea4\u4ee3\u7801\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-sh\">git commit -m &quot;Initial commit&quot;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"4\">\n<li>\u8fdc\u7a0b\u4ed3\u5e93\u5173\u8054\uff08\u4ee5GitHub\u4e3a\u4f8b\uff09\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-sh\">git remote add origin https:\/\/github.com\/username\/repo.git<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"5\">\n<li>\u63a8\u9001\u4ee3\u7801\u5230\u8fdc\u7a0b\u4ed3\u5e93\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-sh\">git push -u origin master<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u516b\u3001\u81ea\u52a8\u5316\u6d4b\u8bd5<\/h3>\n<\/p>\n<p><p>\u81ea\u52a8\u5316\u6d4b\u8bd5\u662f\u4fdd\u8bc1\u4ee3\u7801\u8d28\u91cf\u7684\u91cd\u8981\u624b\u6bb5\u3002\u53ef\u4ee5\u4f7f\u7528unittest\u3001pytest\u7b49\u6d4b\u8bd5\u6846\u67b6\u7f16\u5199\u6d4b\u8bd5\u7528\u4f8b\uff0c\u81ea\u52a8\u5316\u8fd0\u884c\u6d4b\u8bd5\uff0c\u786e\u4fdd\u4ee3\u7801\u529f\u80fd\u6b63\u786e\u3002<\/p>\n<\/p>\n<p><h4>\u793a\u4f8b\uff1a\u4f7f\u7528unittest\u7f16\u5199\u6d4b\u8bd5\u7528\u4f8b<\/h4>\n<\/p>\n<p><pre><code class=\"language-python\">import unittest<\/p>\n<p>def add_numbers(a, b):<\/p>\n<p>    return a + b<\/p>\n<p>class TestMathOperations(unittest.TestCase):<\/p>\n<p>    def test_add_numbers(self):<\/p>\n<p>        self.assertEqual(add_numbers(10, 20), 30)<\/p>\n<p>        self.assertEqual(add_numbers(-1, 1), 0)<\/p>\n<p>        self.assertEqual(add_numbers(0, 0), 0)<\/p>\n<p>if __name__ == &quot;__main__&quot;:<\/p>\n<p>    unittest.main()<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd0\u884c\u4e0a\u8ff0\u6d4b\u8bd5\u7528\u4f8b\uff0cunittest\u4f1a\u81ea\u52a8\u6267\u884c\u6240\u6709\u6d4b\u8bd5\uff0c\u5e76\u62a5\u544a\u6d4b\u8bd5\u7ed3\u679c\u3002<\/p>\n<\/p>\n<p><h3>\u4e5d\u3001\u4ee3\u7801\u89c4\u8303\u548c\u6587\u6863<\/h3>\n<\/p>\n<p><p>\u9075\u5faa\u4ee3\u7801\u89c4\u8303\u548c\u7f16\u5199\u6587\u6863\u662f\u63d0\u9ad8\u4ee3\u7801\u53ef\u8bfb\u6027\u548c\u7ef4\u62a4\u6027\u7684\u5173\u952e\u3002\u53ef\u4ee5\u4f7f\u7528Pylint\u3001Flake8\u7b49\u5de5\u5177\u68c0\u67e5\u4ee3\u7801\u89c4\u8303\uff0c\u4f7f\u7528Sphinx\u7b49\u5de5\u5177\u751f\u6210\u9879\u76ee\u6587\u6863\u3002<\/p>\n<\/p>\n<p><h4>\u793a\u4f8b\uff1a\u4f7f\u7528Pylint\u68c0\u67e5\u4ee3\u7801\u89c4\u8303<\/h4>\n<\/p>\n<p><pre><code class=\"language-sh\">pylint my_script.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>\u793a\u4f8b\uff1a\u4f7f\u7528Sphinx\u751f\u6210\u6587\u6863<\/h4>\n<\/p>\n<ol>\n<li>\u5b89\u88c5Sphinx\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-sh\">pip install sphinx<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"2\">\n<li>\u521d\u59cb\u5316Sphinx\u9879\u76ee\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-sh\">sphinx-quickstart<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"3\">\n<li>\u7f16\u5199\u6587\u6863\uff08\u5728docs\/source\u76ee\u5f55\u4e0b\uff09\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-sh\"># \u793a\u4f8b\u6587\u6863\uff1aindex.rst<\/p>\n<p>Welcome to my_project&#39;s documentation!<\/p>\n<p>======================================<\/p>\n<p>.. toctree::<\/p>\n<p>   :maxdepth: 2<\/p>\n<p>   :caption: Contents:<\/p>\n<p>   modules<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ol start=\"4\">\n<li>\u751f\u6210HTML\u6587\u6863\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-sh\">make html<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h3>\u5341\u3001\u6301\u7eed\u96c6\u6210\u548c\u90e8\u7f72<\/h3>\n<\/p>\n<p><p>\u6301\u7eed\u96c6\u6210\uff08CI\uff09\u548c\u6301\u7eed\u90e8\u7f72\uff08CD\uff09\u53ef\u4ee5\u81ea\u52a8\u5316\u6784\u5efa\u3001\u6d4b\u8bd5\u3001\u90e8\u7f72\u6d41\u7a0b\uff0c\u63d0\u9ad8\u5f00\u53d1\u6548\u7387\u3002\u53ef\u4ee5\u4f7f\u7528Jenkins\u3001GitHub Actions\u7b49\u5de5\u5177\u642d\u5efa<a href=\"https:\/\/docs.pingcode.com\/blog\/devops\/52691.html\" target=\"_blank\">CI\/CD<\/a>\u6d41\u6c34\u7ebf\u3002<\/p>\n<\/p>\n<p><h4>\u793a\u4f8b\uff1a\u4f7f\u7528GitHub Actions\u914d\u7f6eCI\u6d41\u6c34\u7ebf<\/h4>\n<\/p>\n<ol>\n<li>\u5728\u9879\u76ee\u6839\u76ee\u5f55\u4e0b\u521b\u5efa.github\/workflows\u76ee\u5f55\u3002<\/li>\n<li>\u5728.github\/workflows\u76ee\u5f55\u4e0b\u521b\u5efaci.yml\u6587\u4ef6\uff0c\u914d\u7f6eCI\u6d41\u6c34\u7ebf\uff1a<\/li>\n<\/ol>\n<p><pre><code class=\"language-yaml\">name: CI<\/p>\n<p>on: [push]<\/p>\n<p>jobs:<\/p>\n<p>  build:<\/p>\n<p>    runs-on: ubuntu-latest<\/p>\n<p>    steps:<\/p>\n<p>    - uses: actions\/checkout@v2<\/p>\n<p>    - name: Set up Python<\/p>\n<p>      uses: actions\/setup-python@v2<\/p>\n<p>      with:<\/p>\n<p>        python-version: 3.8<\/p>\n<p>    - name: Install dependencies<\/p>\n<p>      run: |<\/p>\n<p>        python -m pip install --upgrade pip<\/p>\n<p>        pip install -r requirements.txt<\/p>\n<p>    - name: Run tests<\/p>\n<p>      run: |<\/p>\n<p>        pytest<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5f53\u4ee3\u7801\u63a8\u9001\u5230GitHub\u4ed3\u5e93\u65f6\uff0cGitHub Actions\u4f1a\u81ea\u52a8\u8fd0\u884cCI\u6d41\u6c34\u7ebf\uff0c\u6267\u884c\u6784\u5efa\u3001\u6d4b\u8bd5\u7b49\u4efb\u52a1\u3002<\/p>\n<\/p>\n<p><h3>\u5341\u4e00\u3001<a href=\"https:\/\/docs.pingcode.com\/blog\/project-management\/23316.html\" target=\"_blank\">\u9879\u76ee\u7ba1\u7406<\/a>\u548c\u534f\u4f5c<\/h3>\n<\/p>\n<p><p>\u826f\u597d\u7684\u9879\u76ee\u7ba1\u7406\u548c\u534f\u4f5c\u662f\u4fdd\u8bc1\u9879\u76ee\u987a\u5229\u8fdb\u884c\u7684\u5173\u952e\u3002\u53ef\u4ee5\u4f7f\u7528Trello\u3001Jira\u7b49\u9879\u76ee\u7ba1\u7406\u5de5\u5177\uff0c\u7ed3\u5408Scrum\u3001Kanban\u7b49<a href=\"https:\/\/docs.pingcode.com\/agile\" target=\"_blank\">\u654f\u6377\u5f00\u53d1<\/a>\u65b9\u6cd5\uff0c\u63d0\u9ad8\u56e2\u961f\u534f\u4f5c\u6548\u7387\u3002<\/p>\n<\/p>\n<p><h4>\u793a\u4f8b\uff1a\u4f7f\u7528Trello\u7ba1\u7406\u9879\u76ee<\/h4>\n<\/p>\n<ol>\n<li>\u521b\u5efaTrello Board\uff0c\u5212\u5206\u4efb\u52a1\u5217\u8868\uff08\u5982To Do\u3001In Progress\u3001Done\u7b49\uff09\u3002<\/li>\n<li>\u521b\u5efa\u4efb\u52a1\u5361\u7247\uff0c\u5206\u914d\u7ed9\u56e2\u961f\u6210\u5458\uff0c\u8bbe\u7f6e\u622a\u6b62\u65e5\u671f\u3002<\/li>\n<li>\u5b9a\u671f\u53ec\u5f00\u7ad9\u4f1a\uff0c\u66f4\u65b0\u4efb\u52a1\u72b6\u6001\uff0c\u89e3\u51b3\u56e2\u961f\u9047\u5230\u7684\u95ee\u9898\u3002<\/li>\n<\/ol>\n<p><h3>\u5341\u4e8c\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u65b0\u5efaPython\u7f16\u8f91\u5668\u6d89\u53ca\u591a\u4e2a\u6b65\u9aa4\uff0c\u5305\u62ec\u9009\u62e9\u9002\u5408\u7684IDE\u3001\u5b89\u88c5Python\u3001\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u3001\u5b89\u88c5\u5fc5\u8981\u7684\u5e93\u548c\u63d2\u4ef6\u3001\u7f16\u5199\u548c\u8fd0\u884c\u4ee3\u7801\u3001\u8c03\u8bd5\u548c\u4f18\u5316\u4ee3\u7801\u3001\u4f7f\u7528\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u3001\u7f16\u5199\u81ea\u52a8\u5316\u6d4b\u8bd5\u3001\u9075\u5faa\u4ee3\u7801\u89c4\u8303\u548c\u7f16\u5199\u6587\u6863\u3001\u642d\u5efa\u6301\u7eed\u96c6\u6210\u548c\u90e8\u7f72\u6d41\u6c34\u7ebf\u3001\u8fdb\u884c\u9879\u76ee\u7ba1\u7406\u548c\u534f\u4f5c\u7b49\u3002\u901a\u8fc7\u5408\u7406\u9009\u62e9\u548c\u914d\u7f6e\u8fd9\u4e9b\u5de5\u5177\u548c\u65b9\u6cd5\uff0c\u53ef\u4ee5\u6781\u5927\u63d0\u9ad8Python\u5f00\u53d1\u7684\u6548\u7387\u548c\u8d28\u91cf\u3002<\/p>\n<\/p>\n<p><p>\u5e0c\u671b\u672c\u6587\u5bf9\u4f60\u65b0\u5efaPython\u7f16\u8f91\u5668\u6709\u6240\u5e2e\u52a9\uff0c\u795d\u4f60\u5f00\u53d1\u987a\u5229\uff01<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u9009\u62e9\u5408\u9002\u7684Python\u7f16\u8f91\u5668\uff1f<\/strong><br \/>\u9009\u62e9Python\u7f16\u8f91\u5668\u65f6\uff0c\u7528\u6237\u9700\u8981\u8003\u8651\u591a\u4e2a\u56e0\u7d20\uff0c\u4f8b\u5982\u529f\u80fd\u3001\u6613\u7528\u6027\u548c\u793e\u533a\u652f\u6301\u7b49\u3002\u5e38\u89c1\u7684Python\u7f16\u8f91\u5668\u5305\u62ecPyCharm\u3001VS Code\u3001Jupyter Notebook\u7b49\u3002PyCharm\u9002\u5408\u5927\u578b\u9879\u76ee\uff0c\u5177\u6709\u5f3a\u5927\u7684\u8c03\u8bd5\u529f\u80fd\uff1bVS Code\u8f7b\u91cf\u4e14\u53ef\u6269\u5c55\uff0c\u9002\u5408\u591a\u79cd\u7f16\u7a0b\u8bed\u8a00\uff1b\u800cJupyter Notebook\u5219\u975e\u5e38\u9002\u5408\u6570\u636e\u5206\u6790\u548c\u53ef\u89c6\u5316\uff0c\u80fd\u591f\u5c06\u4ee3\u7801\u3001\u6587\u672c\u548c\u56fe\u8868\u6574\u5408\u5728\u4e00\u4e2a\u6587\u6863\u4e2d\u3002<\/p>\n<p><strong>\u65b0\u624b\u5982\u4f55\u5feb\u901f\u4e0a\u624bPython\u7f16\u8f91\u5668\uff1f<\/strong><br \/>\u5bf9\u4e8e\u65b0\u624b\u6765\u8bf4\uff0c\u5feb\u901f\u4e0a\u624bPython\u7f16\u8f91\u5668\u53ef\u4ee5\u901a\u8fc7\u67e5\u770b\u5b98\u65b9\u6587\u6863\u548c\u5728\u7ebf\u6559\u7a0b\u6765\u5b9e\u73b0\u3002\u8bb8\u591a\u7f16\u8f91\u5668\u90fd\u63d0\u4f9b\u4e86\u4e30\u5bcc\u7684\u5b66\u4e60\u8d44\u6e90\u548c\u793a\u4f8b\u4ee3\u7801\u3002\u6b64\u5916\uff0c\u793e\u533a\u8bba\u575b\u548c\u89c6\u9891\u6559\u7a0b\u4e5f\u80fd\u5e2e\u52a9\u7528\u6237\u89e3\u51b3\u5728\u4f7f\u7528\u8fc7\u7a0b\u4e2d\u9047\u5230\u7684\u95ee\u9898\uff0c\u51cf\u5c11\u5b66\u4e60\u66f2\u7ebf\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728Python\u7f16\u8f91\u5668\u4e2d\u5b89\u88c5\u548c\u7ba1\u7406\u7b2c\u4e09\u65b9\u5e93\uff1f<\/strong><br \/>\u5728\u5927\u591a\u6570Python\u7f16\u8f91\u5668\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u96c6\u6210\u7684\u7ec8\u7aef\u6216\u547d\u4ee4\u884c\u5de5\u5177\u6765\u5b89\u88c5\u548c\u7ba1\u7406\u7b2c\u4e09\u65b9\u5e93\u3002\u4f8b\u5982\uff0c\u4f7f\u7528pip\u53ef\u4ee5\u8f7b\u677e\u5b89\u88c5\u6240\u9700\u7684\u5e93\u3002\u5728VS Code\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6e\u865a\u62df\u73af\u5883\u6765\u9694\u79bb\u9879\u76ee\u4f9d\u8d56\uff0c\u786e\u4fdd\u4e0d\u540c\u9879\u76ee\u4e4b\u95f4\u4e0d\u4f1a\u53d1\u751f\u5e93\u51b2\u7a81\u3002\u7528\u6237\u4e5f\u53ef\u4ee5\u5728\u7f16\u8f91\u5668\u7684\u6269\u5c55\u5e02\u573a\u4e2d\u5bfb\u627e\u4e0ePython\u76f8\u5173\u7684\u63d2\u4ef6\uff0c\u63d0\u5347\u5f00\u53d1\u6548\u7387\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u65b0\u5efaPython\u7f16\u8f91\u5668\u7684\u65b9\u6cd5\u5305\u62ec\uff1a\u9009\u62e9\u4e00\u4e2aIDE\u3001\u5b89\u88c5Python\u3001\u914d\u7f6e\u73af\u5883\u53d8\u91cf\u3001\u5b89\u88c5\u5fc5\u8981\u7684\u5e93\u548c\u63d2\u4ef6\u3001\u7f16\u5199\u548c\u8fd0 [&hellip;]","protected":false},"author":3,"featured_media":1163293,"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\/1163281"}],"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=1163281"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1163281\/revisions"}],"predecessor-version":[{"id":1163297,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1163281\/revisions\/1163297"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1163293"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1163281"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1163281"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1163281"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}