{"id":1033771,"date":"2024-12-31T11:44:38","date_gmt":"2024-12-31T03:44:38","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1033771.html"},"modified":"2024-12-31T11:44:40","modified_gmt":"2024-12-31T03:44:40","slug":"%e5%a6%82%e4%bd%95%e6%89%a7%e8%a1%8cpython%e4%b8%ad%e7%9a%84%e4%b8%80%e6%ae%b5","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1033771.html","title":{"rendered":"\u5982\u4f55\u6267\u884cPython\u4e2d\u7684\u4e00\u6bb5"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-docs.pingcode.com\/wp-content\/uploads\/2024\/12\/49cb0440-425d-44d1-a9d4-597cc118f80a.webp?x-oss-process=image\/auto-orient,1\/format,webp\" alt=\"\u5982\u4f55\u6267\u884cPython\u4e2d\u7684\u4e00\u6bb5\" \/><\/p>\n<p><p> \u5728Python\u4e2d\u6267\u884c\u4e00\u6bb5\u4ee3\u7801\u7684\u65b9\u5f0f\u6709\u591a\u79cd\uff0c\u5305\u62ec\u4f7f\u7528\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668\u3001\u811a\u672c\u6587\u4ef6\u3001\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u3001\u4ee5\u53caJupyter Notebook\u7b49\u3002<strong>\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668\u3001\u811a\u672c\u6587\u4ef6\u3001\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u3001Jupyter Notebook<\/strong>\u3002\u5176\u4e2d\uff0c\u4f7f\u7528\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668\u662f\u4e00\u79cd\u6700\u76f4\u63a5\u7684\u65b9\u5f0f\uff0c\u9002\u5408\u5feb\u901f\u6d4b\u8bd5\u548c\u8c03\u8bd5\u4ee3\u7801\u7247\u6bb5\u3002\u901a\u8fc7\u5728\u7ec8\u7aef\u6216\u547d\u4ee4\u884c\u8f93\u5165<code>python<\/code>\u547d\u4ee4\uff0c\u53ef\u4ee5\u542f\u52a8Python\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668\uff0c\u7136\u540e\u76f4\u63a5\u8f93\u5165\u4ee3\u7801\u5e76\u67e5\u770b\u6267\u884c\u7ed3\u679c\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668<\/h3>\n<\/p>\n<p><p>\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668\u662fPython\u63d0\u4f9b\u7684\u4e00\u79cd\u53ef\u4ee5\u76f4\u63a5\u5728\u7ec8\u7aef\u6216\u547d\u4ee4\u884c\u4e2d\u6267\u884c\u4ee3\u7801\u7684\u5de5\u5177\u3002\u5b83\u7684\u4e3b\u8981\u4f18\u70b9\u662f\u7b80\u5355\u5feb\u6377\uff0c\u9002\u5408\u7528\u4e8e\u6d4b\u8bd5\u548c\u8c03\u8bd5\u5c0f\u6bb5\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><h4>1. \u542f\u52a8\u548c\u4f7f\u7528\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668<\/h4>\n<\/p>\n<p><p>\u5728\u7ec8\u7aef\u6216\u547d\u4ee4\u884c\u4e2d\u8f93\u5165<code>python<\/code>\u6216<code>python3<\/code>\uff08\u53d6\u51b3\u4e8e\u5b89\u88c5\u7684Python\u7248\u672c\uff09\uff0c\u5373\u53ef\u542f\u52a8\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668\u3002\u8fdb\u5165\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668\u540e\uff0c\u53ef\u4ee5\u76f4\u63a5\u8f93\u5165Python\u4ee3\u7801\u5e76\u56de\u8f66\u6267\u884c\u3002\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">&gt;&gt;&gt; print(&quot;Hello, World!&quot;)<\/p>\n<p>Hello, World!<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u79cd\u65b9\u5f0f\u975e\u5e38\u9002\u5408\u7528\u4e8e\u5feb\u901f\u9a8c\u8bc1\u4ee3\u7801\u7684\u6b63\u786e\u6027\uff0c\u4f46\u4e0d\u9002\u5408\u7f16\u5199\u548c\u7ef4\u62a4\u8f83\u957f\u7684\u7a0b\u5e8f\u3002<\/p>\n<\/p>\n<p><h4>2. \u4f18\u70b9\u548c\u7f3a\u70b9<\/h4>\n<\/p>\n<p><p><strong>\u4f18\u70b9<\/strong>\uff1a<\/p>\n<\/p>\n<ul>\n<li><strong>\u5feb\u901f\u6d4b\u8bd5<\/strong>\uff1a\u53ef\u4ee5\u7acb\u5373\u770b\u5230\u4ee3\u7801\u6267\u884c\u7ed3\u679c\uff0c\u9002\u5408\u7528\u4e8e\u5feb\u901f\u8c03\u8bd5\u548c\u9a8c\u8bc1\u3002<\/li>\n<li><strong>\u7b80\u5355\u6613\u7528<\/strong>\uff1a\u65e0\u9700\u521b\u5efa\u6587\u4ef6\u6216\u9879\u76ee\u7ed3\u6784\uff0c\u76f4\u63a5\u8f93\u5165\u4ee3\u7801\u5373\u53ef\u3002<\/li>\n<\/ul>\n<p><p><strong>\u7f3a\u70b9<\/strong>\uff1a<\/p>\n<\/p>\n<ul>\n<li><strong>\u4e0d\u9002\u5408\u590d\u6742\u9879\u76ee<\/strong>\uff1a\u4e0d\u9002\u5408\u7f16\u5199\u548c\u7ef4\u62a4\u8f83\u957f\u7684\u7a0b\u5e8f\u6216\u9879\u76ee\u3002<\/li>\n<li><strong>\u4e0d\u6613\u4fdd\u5b58<\/strong>\uff1a\u4ee3\u7801\u6267\u884c\u540e\u4e0d\u4f1a\u81ea\u52a8\u4fdd\u5b58\uff0c\u9700\u8981\u624b\u52a8\u590d\u5236\u7c98\u8d34\u4fdd\u5b58\u3002<\/li>\n<\/ul>\n<p><h3>\u4e8c\u3001\u811a\u672c\u6587\u4ef6<\/h3>\n<\/p>\n<p><p>\u5c06Python\u4ee3\u7801\u4fdd\u5b58\u5230\u6587\u4ef6\u4e2d\uff0c\u7136\u540e\u901a\u8fc7\u547d\u4ee4\u884c\u8fd0\u884c\u811a\u672c\u6587\u4ef6\uff0c\u662f\u6267\u884cPython\u4ee3\u7801\u7684\u53e6\u4e00\u79cd\u5e38\u89c1\u65b9\u5f0f\u3002\u811a\u672c\u6587\u4ef6\u901a\u5e38\u4ee5<code>.py<\/code>\u4e3a\u6269\u5c55\u540d\u3002<\/p>\n<\/p>\n<p><h4>1. \u521b\u5efa\u548c\u8fd0\u884c\u811a\u672c\u6587\u4ef6<\/h4>\n<\/p>\n<p><p>\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\uff08\u5982VS Code\u3001Sublime Text\u3001Notepad++\u7b49\uff09\u521b\u5efa\u4e00\u4e2aPython\u811a\u672c\u6587\u4ef6\uff0c\u4f8b\u5982<code>script.py<\/code>\u3002\u5728\u6587\u4ef6\u4e2d\u7f16\u5199\u4ee3\u7801\uff0c\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\"># script.py<\/p>\n<p>print(&quot;Hello, World!&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u4fdd\u5b58\u6587\u4ef6\u540e\uff0c\u5728\u7ec8\u7aef\u6216\u547d\u4ee4\u884c\u4e2d\u5bfc\u822a\u5230\u811a\u672c\u6587\u4ef6\u6240\u5728\u7684\u76ee\u5f55\uff0c\u5e76\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u8fd0\u884c\u811a\u672c\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">python script.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u4f18\u70b9\u548c\u7f3a\u70b9<\/h4>\n<\/p>\n<p><p><strong>\u4f18\u70b9<\/strong>\uff1a<\/p>\n<\/p>\n<ul>\n<li><strong>\u53ef\u7ef4\u62a4\u6027<\/strong>\uff1a\u4ee3\u7801\u4fdd\u5b58\u5230\u6587\u4ef6\u4e2d\uff0c\u4fbf\u4e8e\u7ef4\u62a4\u548c\u7248\u672c\u63a7\u5236\u3002<\/li>\n<li><strong>\u9002\u5408\u590d\u6742\u9879\u76ee<\/strong>\uff1a\u9002\u5408\u7f16\u5199\u548c\u7ef4\u62a4\u8f83\u957f\u7684\u7a0b\u5e8f\u6216\u9879\u76ee\u3002<\/li>\n<\/ul>\n<p><p><strong>\u7f3a\u70b9<\/strong>\uff1a<\/p>\n<\/p>\n<ul>\n<li><strong>\u4e0d\u5982\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668\u5feb\u6377<\/strong>\uff1a\u6bcf\u6b21\u4fee\u6539\u4ee3\u7801\u540e\u9700\u8981\u91cd\u65b0\u8fd0\u884c\u811a\u672c\u624d\u80fd\u770b\u5230\u7ed3\u679c\u3002<\/li>\n<\/ul>\n<p><h3>\u4e09\u3001\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09<\/h3>\n<\/p>\n<p><p>\u4f7f\u7528\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u662f\u7f16\u5199\u548c\u6267\u884cPython\u4ee3\u7801\u7684\u53e6\u4e00\u79cd\u65b9\u5f0f\u3002IDE\u901a\u5e38\u63d0\u4f9b\u4ee3\u7801\u7f16\u8f91\u3001\u8c03\u8bd5\u3001\u8fd0\u884c\u3001\u7248\u672c\u63a7\u5236\u7b49\u529f\u80fd\uff0c\u6781\u5927\u63d0\u9ad8\u4e86\u5f00\u53d1\u6548\u7387\u3002<\/p>\n<\/p>\n<p><h4>1. \u9009\u62e9\u548c\u4f7f\u7528IDE<\/h4>\n<\/p>\n<p><p>\u5e38\u7528\u7684Python IDE\u5305\u62ecPyCharm\u3001VS Code\u3001Eclipse\uff08\u914d\u5408PyDev\u63d2\u4ef6\uff09\u7b49\u3002\u4ee5PyCharm\u4e3a\u4f8b\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u5b89\u88c5\u5e76\u542f\u52a8PyCharm\u3002<\/li>\n<li>\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Python\u9879\u76ee\u3002<\/li>\n<li>\u5728\u9879\u76ee\u4e2d\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Python\u6587\u4ef6\uff08\u4f8b\u5982<code>m<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>n.py<\/code>\uff09\u3002<\/li>\n<li>\u7f16\u5199\u4ee3\u7801\u5e76\u4fdd\u5b58\uff0c\u4f8b\u5982\uff1a<\/li>\n<\/ul>\n<p><pre><code class=\"language-python\"># main.py<\/p>\n<p>print(&quot;Hello, World!&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<ul>\n<li>\u70b9\u51fb\u8fd0\u884c\u6309\u94ae\u6216\u4f7f\u7528\u5feb\u6377\u952e\u8fd0\u884c\u4ee3\u7801\u3002<\/li>\n<\/ul>\n<p><h4>2. \u4f18\u70b9\u548c\u7f3a\u70b9<\/h4>\n<\/p>\n<p><p><strong>\u4f18\u70b9<\/strong>\uff1a<\/p>\n<\/p>\n<ul>\n<li><strong>\u529f\u80fd\u5f3a\u5927<\/strong>\uff1a\u63d0\u4f9b\u4ee3\u7801\u8865\u5168\u3001\u8bed\u6cd5\u68c0\u67e5\u3001\u8c03\u8bd5\u3001\u7248\u672c\u63a7\u5236\u7b49\u529f\u80fd\u3002<\/li>\n<li><strong>\u9002\u5408\u56e2\u961f\u534f\u4f5c<\/strong>\uff1a\u4fbf\u4e8e\u56e2\u961f\u534f\u4f5c\u5f00\u53d1\u548c\u4ee3\u7801\u7ba1\u7406\u3002<\/li>\n<\/ul>\n<p><p><strong>\u7f3a\u70b9<\/strong>\uff1a<\/p>\n<\/p>\n<ul>\n<li><strong>\u5b66\u4e60\u6210\u672c<\/strong>\uff1a\u9700\u8981\u5b66\u4e60\u548c\u9002\u5e94IDE\u7684\u4f7f\u7528\u3002<\/li>\n<li><strong>\u8d44\u6e90\u6d88\u8017<\/strong>\uff1a\u5360\u7528\u8f83\u591a\u7cfb\u7edf\u8d44\u6e90\uff0c\u53ef\u80fd\u5f71\u54cd\u6027\u80fd\u3002<\/li>\n<\/ul>\n<p><h3>\u56db\u3001Jupyter Notebook<\/h3>\n<\/p>\n<p><p>Jupyter Notebook\u662f\u4e00\u79cd\u4ea4\u4e92\u5f0f\u8ba1\u7b97\u73af\u5883\uff0c\u7279\u522b\u9002\u5408\u6570\u636e\u5206\u6790\u3001\u6570\u636e\u79d1\u5b66\u3001<a href=\"https:\/\/docs.pingcode.com\/ask\/59192.html\" target=\"_blank\">\u673a\u5668\u5b66\u4e60<\/a>\u7b49\u9886\u57df\u3002\u5b83\u4ee5\u5355\u5143\u683c\u7684\u5f62\u5f0f\u7ec4\u7ec7\u4ee3\u7801\u548c\u6587\u672c\uff0c\u4fbf\u4e8e\u9010\u6b65\u6267\u884c\u548c\u5c55\u793a\u7ed3\u679c\u3002<\/p>\n<\/p>\n<p><h4>1. \u5b89\u88c5\u548c\u4f7f\u7528Jupyter Notebook<\/h4>\n<\/p>\n<p><p>Jupyter Notebook\u53ef\u4ee5\u901a\u8fc7Anaconda\u5b89\u88c5\uff0c\u6216\u4f7f\u7528pip\u5b89\u88c5\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-sh\">pip install notebook<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u5728\u7ec8\u7aef\u6216\u547d\u4ee4\u884c\u4e2d\u8f93\u5165<code>jupyter notebook<\/code>\u542f\u52a8Jupyter Notebook\u670d\u52a1\u5668\uff0c\u5e76\u5728\u6d4f\u89c8\u5668\u4e2d\u6253\u5f00Notebook\u754c\u9762\u3002\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Notebook\uff0c\u7f16\u5199\u548c\u6267\u884c\u4ee3\u7801\u5355\u5143\uff0c\u4f8b\u5982\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">print(&quot;Hello, World!&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<p><h4>2. \u4f18\u70b9\u548c\u7f3a\u70b9<\/h4>\n<\/p>\n<p><p><strong>\u4f18\u70b9<\/strong>\uff1a<\/p>\n<\/p>\n<ul>\n<li><strong>\u4ea4\u4e92\u5f0f\u73af\u5883<\/strong>\uff1a\u4fbf\u4e8e\u9010\u6b65\u6267\u884c\u4ee3\u7801\u548c\u67e5\u770b\u7ed3\u679c\uff0c\u9002\u5408\u6570\u636e\u5206\u6790\u548c\u53ef\u89c6\u5316\u3002<\/li>\n<li><strong>\u6587\u6863\u548c\u4ee3\u7801\u7ed3\u5408<\/strong>\uff1a\u53ef\u4ee5\u5728\u540c\u4e00\u6587\u6863\u4e2d\u7ed3\u5408\u4ee3\u7801\u3001\u6587\u672c\u3001\u56fe\u8868\u7b49\uff0c\u4fbf\u4e8e\u5c55\u793a\u548c\u5206\u4eab\u3002<\/li>\n<\/ul>\n<p><p><strong>\u7f3a\u70b9<\/strong>\uff1a<\/p>\n<\/p>\n<ul>\n<li><strong>\u6027\u80fd\u9650\u5236<\/strong>\uff1a\u5bf9\u4e8e\u975e\u5e38\u5927\u7684\u6570\u636e\u96c6\u6216\u590d\u6742\u8fd0\u7b97\uff0c\u6027\u80fd\u53ef\u80fd\u53d7\u5230\u9650\u5236\u3002<\/li>\n<li><strong>\u4e0d\u9002\u5408\u751f\u4ea7\u73af\u5883<\/strong>\uff1a\u66f4\u9002\u5408\u5b9e\u9a8c\u548c\u5206\u6790\uff0c\u4e0d\u9002\u5408\u76f4\u63a5\u7528\u4e8e\u751f\u4ea7\u73af\u5883\u3002<\/li>\n<\/ul>\n<p><h3>\u4e94\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u5728Python\u4e2d\u6267\u884c\u4e00\u6bb5\u4ee3\u7801\u6709\u591a\u79cd\u65b9\u5f0f\uff0c\u5305\u62ec\u4f7f\u7528\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668\u3001\u811a\u672c\u6587\u4ef6\u3001\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u3001\u4ee5\u53caJupyter Notebook\u3002\u6bcf\u79cd\u65b9\u5f0f\u90fd\u6709\u5176\u4f18\u70b9\u548c\u7f3a\u70b9\uff0c\u9002\u5408\u4e0d\u540c\u7684\u5e94\u7528\u573a\u666f\u3002\u5bf9\u4e8e\u5feb\u901f\u6d4b\u8bd5\u548c\u8c03\u8bd5\u4ee3\u7801\uff0c\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668\u548cJupyter Notebook\u662f\u4e0d\u9519\u7684\u9009\u62e9\uff1b\u5bf9\u4e8e\u7f16\u5199\u548c\u7ef4\u62a4\u590d\u6742\u9879\u76ee\uff0c\u811a\u672c\u6587\u4ef6\u548c\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u66f4\u4e3a\u9002\u5408\u3002\u6839\u636e\u5177\u4f53\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u65b9\u5f0f\uff0c\u53ef\u4ee5\u63d0\u9ad8\u5f00\u53d1\u6548\u7387\u548c\u4ee3\u7801\u8d28\u91cf\u3002<\/p>\n<\/p>\n<p><h3>\u516d\u3001\u6df1\u5165\u7406\u89e3\u548c\u5b9e\u8df5<\/h3>\n<\/p>\n<p><p>\u901a\u8fc7\u672c\u6587\u7684\u4ecb\u7ecd\uff0c\u76f8\u4fe1\u8bfb\u8005\u5df2\u7ecf\u5bf9\u5728Python\u4e2d\u6267\u884c\u4e00\u6bb5\u4ee3\u7801\u7684\u591a\u79cd\u65b9\u5f0f\u6709\u4e86\u521d\u6b65\u4e86\u89e3\u3002\u63a5\u4e0b\u6765\uff0c\u53ef\u4ee5\u901a\u8fc7\u5b9e\u9645\u64cd\u4f5c\u548c\u7ec3\u4e60\uff0c\u8fdb\u4e00\u6b65\u638c\u63e1\u8fd9\u4e9b\u65b9\u6cd5\u7684\u4f7f\u7528\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5efa\u8bae\uff1a<\/p>\n<\/p>\n<p><h4>1. \u591a\u5c1d\u8bd5\u4e0d\u540c\u65b9\u5f0f<\/h4>\n<\/p>\n<ul>\n<li><strong>\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668<\/strong>\uff1a\u5c1d\u8bd5\u5728\u7ec8\u7aef\u6216\u547d\u4ee4\u884c\u4e2d\u4f7f\u7528\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668\uff0c\u8f93\u5165\u7b80\u5355\u7684Python\u4ee3\u7801\u5e76\u67e5\u770b\u7ed3\u679c\u3002<\/li>\n<li><strong>\u811a\u672c\u6587\u4ef6<\/strong>\uff1a\u521b\u5efaPython\u811a\u672c\u6587\u4ef6\uff0c\u7f16\u5199\u4ee3\u7801\u5e76\u8fd0\u884c\u811a\u672c\uff0c\u4f53\u9a8c\u6587\u4ef6\u4fdd\u5b58\u548c\u7ba1\u7406\u7684\u4fbf\u5229\u3002<\/li>\n<li><strong>\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09<\/strong>\uff1a\u4e0b\u8f7d\u5e76\u5b89\u88c5\u5e38\u7528\u7684Python IDE\uff08\u5982PyCharm\u3001VS Code\uff09\uff0c\u521b\u5efa\u9879\u76ee\u5e76\u7f16\u5199\u4ee3\u7801\uff0c\u4f53\u9a8cIDE\u7684\u5f3a\u5927\u529f\u80fd\u3002<\/li>\n<li><strong>Jupyter Notebook<\/strong>\uff1a\u5b89\u88c5\u5e76\u542f\u52a8Jupyter Notebook\uff0c\u521b\u5efaNotebook\u6587\u4ef6\uff0c\u7f16\u5199\u548c\u6267\u884c\u4ee3\u7801\u5355\u5143\uff0c\u4f53\u9a8c\u4ea4\u4e92\u5f0f\u8ba1\u7b97\u73af\u5883\u7684\u4f18\u52bf\u3002<\/li>\n<\/ul>\n<p><h4>2. \u6df1\u5165\u5b66\u4e60\u548c\u5e94\u7528<\/h4>\n<\/p>\n<ul>\n<li><strong>\u9605\u8bfb\u6587\u6863\u548c\u6559\u7a0b<\/strong>\uff1a\u901a\u8fc7\u9605\u8bfb\u5b98\u65b9\u6587\u6863\u548c\u76f8\u5173\u6559\u7a0b\uff0c\u6df1\u5165\u4e86\u89e3\u4e0d\u540c\u65b9\u5f0f\u7684\u4f7f\u7528\u65b9\u6cd5\u548c\u6ce8\u610f\u4e8b\u9879\u3002<\/li>\n<li><strong>\u53c2\u4e0e\u5f00\u6e90\u9879\u76ee<\/strong>\uff1a\u901a\u8fc7\u53c2\u4e0e\u5f00\u6e90\u9879\u76ee\uff0c\u5b66\u4e60\u548c\u501f\u9274\u4ed6\u4eba\u7684\u4ee3\u7801\u548c\u5f00\u53d1\u7ecf\u9a8c\uff0c\u63d0\u5347\u81ea\u5df1\u7684\u7f16\u7a0b\u6c34\u5e73\u3002<\/li>\n<li><strong>\u5b9e\u8df5\u9879\u76ee<\/strong>\uff1a\u9009\u62e9\u4e00\u4e2a\u611f\u5174\u8da3\u7684\u9879\u76ee\uff0c\u5c1d\u8bd5\u4f7f\u7528\u4e0d\u540c\u65b9\u5f0f\u7f16\u5199\u548c\u6267\u884c\u4ee3\u7801\uff0c\u79ef\u7d2f\u5b9e\u9645\u5f00\u53d1\u7ecf\u9a8c\u3002<\/li>\n<\/ul>\n<p><p>\u901a\u8fc7\u4e0d\u65ad\u5b66\u4e60\u548c\u5b9e\u8df5\uff0c\u76f8\u4fe1\u8bfb\u8005\u80fd\u591f\u719f\u7ec3\u638c\u63e1\u5728Python\u4e2d\u6267\u884c\u4ee3\u7801\u7684\u591a\u79cd\u65b9\u5f0f\uff0c\u5e76\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d\u7075\u6d3b\u5e94\u7528\uff0c\u63d0\u5347\u5f00\u53d1\u6548\u7387\u548c\u4ee3\u7801\u8d28\u91cf\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Python\u4e2d\u8fd0\u884c\u4e00\u6bb5\u4ee3\u7801\uff1f<\/strong><br \/>\u5728Python\u4e2d\u8fd0\u884c\u4ee3\u7801\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u5b9e\u73b0\u3002\u6700\u5e38\u89c1\u7684\u65b9\u6cd5\u662f\u4f7f\u7528Python\u89e3\u91ca\u5668\u6216\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u3002\u4f60\u53ef\u4ee5\u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165<code>python<\/code>\u6765\u542f\u52a8\u89e3\u91ca\u5668\uff0c\u76f4\u63a5\u8f93\u5165\u4ee3\u7801\u5e76\u6309\u56de\u8f66\u6267\u884c\u3002\u6b64\u5916\uff0c\u4f7f\u7528IDE\u5982PyCharm\u6216VSCode\uff0c\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Python\u6587\u4ef6\uff0c\u5c06\u4ee3\u7801\u5199\u5165\u5176\u4e2d\uff0c\u7136\u540e\u901a\u8fc7\u8fd0\u884c\u6309\u94ae\u6216\u5feb\u6377\u952e\u76f4\u63a5\u6267\u884c\u3002<\/p>\n<p><strong>\u5982\u4f55\u5728Jupyter Notebook\u4e2d\u6267\u884cPython\u4ee3\u7801\uff1f<\/strong><br \/>\u5728Jupyter Notebook\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u521b\u5efa\u65b0\u7684\u4ee3\u7801\u5355\u5143\u6765\u8fd0\u884cPython\u4ee3\u7801\u3002\u8f93\u5165\u4ee3\u7801\u540e\uff0c\u6309Shift + Enter\u952e\u5373\u53ef\u6267\u884c\u8be5\u5355\u5143\u5e76\u663e\u793a\u8f93\u51fa\u3002Jupyter Notebook\u652f\u6301\u4ea4\u4e92\u5f0f\u7f16\u7a0b\uff0c\u80fd\u591f\u5728\u540c\u4e00\u73af\u5883\u4e2d\u9010\u6b65\u8fd0\u884c\u4ee3\u7801\uff0c\u67e5\u770b\u7ed3\u679c\uff0c\u975e\u5e38\u9002\u5408\u6570\u636e\u5206\u6790\u548c\u53ef\u89c6\u5316\u3002<\/p>\n<p><strong>\u5982\u4f55\u5904\u7406Python\u4ee3\u7801\u6267\u884c\u4e2d\u7684\u9519\u8bef\uff1f<\/strong><br \/>\u4ee3\u7801\u6267\u884c\u4e2d\u53ef\u80fd\u4f1a\u9047\u5230\u5404\u79cd\u9519\u8bef\uff0c\u4f8b\u5982\u8bed\u6cd5\u9519\u8bef\u6216\u8fd0\u884c\u65f6\u9519\u8bef\u3002\u4f7f\u7528try-except\u8bed\u53e5\u53ef\u4ee5\u5e2e\u52a9\u6355\u83b7\u5e76\u5904\u7406\u8fd9\u4e9b\u9519\u8bef\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u5c06\u53ef\u80fd\u5f15\u53d1\u9519\u8bef\u7684\u4ee3\u7801\u653e\u5728try\u5757\u4e2d\uff0c\u5982\u679c\u53d1\u751f\u9519\u8bef\uff0c\u5219\u6267\u884cexcept\u5757\u4e2d\u7684\u4ee3\u7801\u3002\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u80fd\u591f\u66f4\u597d\u5730\u63a7\u5236\u7a0b\u5e8f\u7684\u6267\u884c\u6d41\u7a0b\u5e76\u63d0\u4f9b\u7528\u6237\u53cb\u597d\u7684\u9519\u8bef\u63d0\u793a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5728Python\u4e2d\u6267\u884c\u4e00\u6bb5\u4ee3\u7801\u7684\u65b9\u5f0f\u6709\u591a\u79cd\uff0c\u5305\u62ec\u4f7f\u7528\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668\u3001\u811a\u672c\u6587\u4ef6\u3001\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u3001\u4ee5\u53caJupy [&hellip;]","protected":false},"author":3,"featured_media":1033782,"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\/1033771"}],"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=1033771"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1033771\/revisions"}],"predecessor-version":[{"id":1033785,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1033771\/revisions\/1033785"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1033782"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1033771"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1033771"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1033771"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}