{"id":1052847,"date":"2024-12-31T14:28:35","date_gmt":"2024-12-31T06:28:35","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1052847.html"},"modified":"2024-12-31T14:28:39","modified_gmt":"2024-12-31T06:28:39","slug":"%e5%a6%82%e4%bd%95%e5%90%af%e5%8a%a8python%e8%a7%a3%e9%87%8a%e5%99%a8%e8%87%aa%e5%b8%a6%e7%9a%84idle","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1052847.html","title":{"rendered":"\u5982\u4f55\u542f\u52a8python\u89e3\u91ca\u5668\u81ea\u5e26\u7684idle"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-docs.pingcode.com\/wp-content\/uploads\/2024\/12\/849effa6-13d0-4ca2-9d5d-c2153371422c.webp?x-oss-process=image\/auto-orient,1\/format,webp\" alt=\"\u5982\u4f55\u542f\u52a8python\u89e3\u91ca\u5668\u81ea\u5e26\u7684idle\" \/><\/p>\n<p><p> <strong>\u8981\u542f\u52a8Python\u89e3\u91ca\u5668\u81ea\u5e26\u7684IDLE\uff0c\u53ef\u4ee5\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u64cd\u4f5c\uff1a\u6253\u5f00\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u3001\u8f93\u5165 &#39;idle&#39; \u547d\u4ee4\u5e76\u6309\u4e0b\u56de\u8f66\u952e\u3002<\/strong> \u5728\u4ee5\u4e0b\u5185\u5bb9\u4e2d\uff0c\u6211\u5c06\u8be6\u7ec6\u63cf\u8ff0\u8fd9\u4e24\u4e2a\u6b65\u9aa4\uff0c\u5e76\u4ecb\u7ecd\u4e00\u4e9b\u5176\u4ed6\u76f8\u5173\u6280\u5de7\u548c\u6ce8\u610f\u4e8b\u9879\u3002<\/p>\n<\/p>\n<p><h2>\u4e00\u3001\u6253\u5f00\u547d\u4ee4\u884c\u6216\u7ec8\u7aef<\/h2>\n<\/p>\n<p><p>\u5728\u542f\u52a8IDLE\u4e4b\u524d\uff0c\u9996\u5148\u9700\u8981\u6253\u5f00\u547d\u4ee4\u884c\uff08\u5728Windows\u7cfb\u7edf\u4e2d\uff09\u6216\u7ec8\u7aef\uff08\u5728macOS\u548cLinux\u7cfb\u7edf\u4e2d\uff09\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u5728\u4e0d\u540c\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u6253\u5f00\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u7684\u8be6\u7ec6\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>Windows<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u6309\u4e0b <code>Win + R<\/code> \u952e\uff0c\u6253\u5f00\u201c\u8fd0\u884c\u201d\u5bf9\u8bdd\u6846\u3002<\/li>\n<li>\u5728\u201c\u8fd0\u884c\u201d\u5bf9\u8bdd\u6846\u4e2d\u8f93\u5165 <code>cmd<\/code>\uff0c\u7136\u540e\u6309\u4e0b\u56de\u8f66\u952e\uff0c\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>macOS<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u901a\u8fc7 Spotlight \u641c\u7d22\uff08\u6309\u4e0b <code>Cmd + \u7a7a\u683c<\/code>\uff09\uff0c\u8f93\u5165 <code>Terminal<\/code> \u5e76\u9009\u62e9\u7ec8\u7aef\u5e94\u7528\u7a0b\u5e8f\u3002<\/li>\n<li>\u4e5f\u53ef\u4ee5\u4ece\u201c\u5e94\u7528\u7a0b\u5e8f\u201d\u6587\u4ef6\u5939\u4e2d\u627e\u5230\u5e76\u6253\u5f00\u201c\u5b9e\u7528\u5de5\u5177\u201d\u6587\u4ef6\u5939\uff0c\u53cc\u51fb\u201c\u7ec8\u7aef\u201d\u5e94\u7528\u7a0b\u5e8f\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>Linux<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u901a\u8fc7\u7cfb\u7edf\u83dc\u5355\u627e\u5230\u5e76\u6253\u5f00\u7ec8\u7aef\u3002<\/li>\n<li>\u4e5f\u53ef\u4ee5\u4f7f\u7528\u5feb\u6377\u952e\uff08\u901a\u5e38\u662f <code>Ctrl + Alt + T<\/code>\uff09\u6253\u5f00\u7ec8\u7aef\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h2>\u4e8c\u3001\u8f93\u5165 &#39;idle&#39; \u547d\u4ee4\u5e76\u6309\u4e0b\u56de\u8f66\u952e<\/h2>\n<\/p>\n<p><p>\u4e00\u65e6\u6253\u5f00\u4e86\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\uff0c\u63a5\u4e0b\u6765\u53ea\u9700\u8f93\u5165 <code>idle<\/code> \u547d\u4ee4\u5e76\u6309\u4e0b\u56de\u8f66\u952e\uff0c\u5373\u53ef\u542f\u52a8Python\u89e3\u91ca\u5668\u81ea\u5e26\u7684IDLE\u3002\u5177\u4f53\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p>\u5728\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u7a97\u53e3\u4e2d\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-bash\">idle<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\n<p>\u6309\u4e0b\u56de\u8f66\u952e\u3002\u5982\u679cPython\u5df2\u6b63\u786e\u5b89\u88c5\u5e76\u914d\u7f6e\uff0cIDLE\u4f1a\u81ea\u52a8\u542f\u52a8\u5e76\u663e\u793a\u5176\u56fe\u5f62\u7528\u6237\u754c\u9762\u3002<\/p>\n<\/p>\n<\/li>\n<\/ol>\n<p><h2>\u4e09\u3001\u68c0\u67e5Python\u8def\u5f84\u4e0e\u73af\u5883\u53d8\u91cf<\/h2>\n<\/p>\n<p><p>\u6709\u65f6\uff0c\u76f4\u63a5\u8f93\u5165 <code>idle<\/code> \u547d\u4ee4\u53ef\u80fd\u4e0d\u4f1a\u542f\u52a8IDLE\u3002\u8fd9\u901a\u5e38\u662f\u56e0\u4e3aPython\u7684\u8def\u5f84\u672a\u6dfb\u52a0\u5230\u7cfb\u7edf\u7684\u73af\u5883\u53d8\u91cf\u4e2d\u3002\u4ee5\u4e0b\u662f\u68c0\u67e5\u548c\u914d\u7f6e\u8def\u5f84\u7684\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>Windows<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u6253\u5f00\u201c\u7cfb\u7edf\u5c5e\u6027\u201d\u7a97\u53e3\uff08\u53f3\u952e\u70b9\u51fb\u201c\u6b64\u7535\u8111\u201d\u6216\u201c\u6211\u7684\u7535\u8111\u201d\uff0c\u9009\u62e9\u201c\u5c5e\u6027\u201d\uff0c\u7136\u540e\u70b9\u51fb\u201c\u9ad8\u7ea7\u7cfb\u7edf\u8bbe\u7f6e\u201d\uff09\u3002<\/li>\n<li>\u5728\u201c\u9ad8\u7ea7\u201d\u9009\u9879\u5361\u4e2d\uff0c\u70b9\u51fb\u201c\u73af\u5883\u53d8\u91cf\u201d\u3002<\/li>\n<li>\u5728\u201c\u7cfb\u7edf\u53d8\u91cf\u201d\u90e8\u5206\uff0c\u627e\u5230\u5e76\u9009\u62e9\u201cPath\u201d\u53d8\u91cf\uff0c\u70b9\u51fb\u201c\u7f16\u8f91\u201d\u3002<\/li>\n<li>\u786e\u4fddPython\u7684\u5b89\u88c5\u76ee\u5f55\u8def\u5f84\uff08\u4f8b\u5982 <code>C:\\Python39<\/code> \u6216 <code>C:\\Users\\&lt;YourUsername&gt;\\AppData\\Local\\Programs\\Python\\Python39\\<\/code>\uff09\u5df2\u6dfb\u52a0\u5230Path\u53d8\u91cf\u4e2d\u3002\u5982\u679c\u6ca1\u6709\uff0c\u70b9\u51fb\u201c\u65b0\u5efa\u201d\u5e76\u6dfb\u52a0\u76f8\u5e94\u7684\u8def\u5f84\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>macOS\/Linux<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u6253\u5f00\u7ec8\u7aef\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u68c0\u67e5Python\u8def\u5f84\uff1a\n<pre><code class=\"language-bash\">which python3<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\u5982\u679cPython\u8def\u5f84\u672a\u5728\u8f93\u51fa\u4e2d\u663e\u793a\uff0c\u53ef\u4ee5\u7f16\u8f91 <code>.bash_profile<\/code>\u3001<code>.zshrc<\/code> \u6216 <code>.bashrc<\/code> \u6587\u4ef6\uff08\u53d6\u51b3\u4e8e\u4f7f\u7528\u7684shell\uff09\uff0c\u6dfb\u52a0\u4ee5\u4e0b\u884c\uff1a\n<pre><code class=\"language-bash\">export PATH=&quot;\/usr\/local\/bin\/python3:$PATH&quot;<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<li>\u4fdd\u5b58\u6587\u4ef6\u5e76\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u4f7f\u66f4\u6539\u751f\u6548\uff1a\n<pre><code class=\"language-bash\">source ~\/.bash_profile<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h2>\u56db\u3001\u901a\u8fc7Python\u5b89\u88c5\u76ee\u5f55\u542f\u52a8IDLE<\/h2>\n<\/p>\n<p><p>\u5982\u679c\u4e0a\u8ff0\u65b9\u6cd5\u4ecd\u7136\u65e0\u6cd5\u542f\u52a8IDLE\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u76f4\u63a5\u901a\u8fc7Python\u5b89\u88c5\u76ee\u5f55\u542f\u52a8IDLE\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>Windows<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\uff0c\u5bfc\u822a\u5230Python\u7684\u5b89\u88c5\u76ee\u5f55\u3002\u901a\u5e38\u8def\u5f84\u7c7b\u4f3c\u4e8e <code>C:\\Python39<\/code> \u6216 <code>C:\\Users\\&lt;YourUsername&gt;\\AppData\\Local\\Programs\\Python\\Python39\\<\/code>\u3002<\/li>\n<li>\u5728\u8be5\u76ee\u5f55\u4e0b\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8IDLE\uff1a\n<pre><code class=\"language-bash\">python idle.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>macOS\/Linux<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u6253\u5f00\u7ec8\u7aef\uff0c\u5bfc\u822a\u5230Python\u7684\u5b89\u88c5\u76ee\u5f55\u3002\u901a\u5e38\u8def\u5f84\u7c7b\u4f3c\u4e8e <code>\/usr\/local\/bin\/python3<\/code> \u6216 <code>\/usr\/bin\/python3<\/code>\u3002<\/li>\n<li>\u5728\u8be5\u76ee\u5f55\u4e0b\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8IDLE\uff1a\n<pre><code class=\"language-bash\">python3 -m idlelib.idle<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h2>\u4e94\u3001\u901a\u8fc7\u56fe\u5f62\u7528\u6237\u754c\u9762\u542f\u52a8IDLE<\/h2>\n<\/p>\n<p><p>\u6709\u65f6\uff0c\u901a\u8fc7\u56fe\u5f62\u7528\u6237\u754c\u9762\u542f\u52a8IDLE\u53ef\u80fd\u66f4\u52a0\u65b9\u4fbf\u3002\u4ee5\u4e0b\u662f\u4e0d\u540c\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u901a\u8fc7\u56fe\u5f62\u7528\u6237\u754c\u9762\u542f\u52a8IDLE\u7684\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>Windows<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u5728\u201c\u5f00\u59cb\u201d\u83dc\u5355\u4e2d\uff0c\u627e\u5230\u5e76\u5c55\u5f00Python\u6587\u4ef6\u5939\u3002<\/li>\n<li>\u70b9\u51fb\u201cIDLE (Python 3.x.x)\u201d\u56fe\u6807\u542f\u52a8IDLE\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>macOS<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u5728\u201c\u5e94\u7528\u7a0b\u5e8f\u201d\u6587\u4ef6\u5939\u4e2d\u627e\u5230Python\u5b89\u88c5\u76ee\u5f55\uff08\u901a\u5e38\u540d\u4e3a <code>Python 3.x<\/code>\uff09\u3002<\/li>\n<li>\u53cc\u51fb\u201cIDLE\u201d\u5e94\u7528\u7a0b\u5e8f\u542f\u52a8IDLE\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>Linux<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u901a\u8fc7\u7cfb\u7edf\u83dc\u5355\u627e\u5230\u5e76\u6253\u5f00Python\u5b89\u88c5\u76ee\u5f55\u3002<\/li>\n<li>\u542f\u52a8\u201cIDLE\u201d\u5e94\u7528\u7a0b\u5e8f\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h2>\u516d\u3001\u68c0\u67e5Python\u7248\u672c\u4e0eIDLE\u517c\u5bb9\u6027<\/h2>\n<\/p>\n<p><p>\u6709\u65f6\uff0cPython\u7248\u672c\u4e0eIDLE\u7248\u672c\u4e4b\u95f4\u7684\u517c\u5bb9\u6027\u95ee\u9898\u53ef\u80fd\u5bfc\u81f4IDLE\u65e0\u6cd5\u542f\u52a8\u3002\u4ee5\u4e0b\u662f\u68c0\u67e5\u548c\u89e3\u51b3\u517c\u5bb9\u6027\u95ee\u9898\u7684\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u68c0\u67e5Python\u7248\u672c<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u5728\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff0c\u68c0\u67e5\u5df2\u5b89\u88c5\u7684Python\u7248\u672c\uff1a\n<pre><code class=\"language-bash\">python --version<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u66f4\u65b0Python\u4e0eIDLE<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u5982\u679cPython\u7248\u672c\u8fc7\u65e7\uff0c\u53ef\u4ee5\u4e0b\u8f7d\u5e76\u5b89\u88c5\u6700\u65b0\u7248\u672c\u7684Python\u3002\u8bbf\u95eePython\u5b98\u65b9\u7f51\u7ad9\uff08<a href=\"https:\/\/www.python.org\/%EF%BC%89%E4%B8%8B%E8%BD%BD%E6%9C%80%E6%96%B0%E7%89%88%E6%9C%AC%E7%9A%84%E5%AE%89%E8%A3%85%E5%8C%85%E5%B9%B6%E5%AE%89%E8%A3%85%E3%80%82\">https:\/\/www.python.org\/\uff09\u4e0b\u8f7d\u6700\u65b0\u7248\u672c\u7684\u5b89\u88c5\u5305\u5e76\u5b89\u88c5\u3002<\/a><\/li>\n<li>\u5b89\u88c5\u6700\u65b0\u7248\u672c\u7684Python\u540e\uff0cIDLE\u4e5f\u4f1a\u968f\u4e4b\u66f4\u65b0\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h2>\u4e03\u3001\u914d\u7f6eIDLE\u7684\u542f\u52a8\u9009\u9879<\/h2>\n<\/p>\n<p><p>IDLE\u63d0\u4f9b\u4e86\u4e00\u4e9b\u542f\u52a8\u9009\u9879\uff0c\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u8fd9\u4e9b\u9009\u9879\u5b9a\u5236IDLE\u7684\u542f\u52a8\u884c\u4e3a\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u7528\u542f\u52a8\u9009\u9879\u7684\u4ecb\u7ecd\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>-n<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u4f7f\u7528 <code>-n<\/code> \u9009\u9879\u542f\u52a8IDLE\uff0c\u4f7f\u5176\u4e0d\u4f7f\u7528\u5b50\u8fdb\u7a0b\u3002\u9002\u7528\u4e8e\u8c03\u8bd5\u6269\u5c55\u6a21\u5757\u6216\u9700\u8981\u4e0e\u4e3b\u8fdb\u7a0b\u8fdb\u884c\u4ea4\u4e92\u7684\u60c5\u51b5\u3002\n<pre><code class=\"language-bash\">idle -n<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>-e<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u4f7f\u7528 <code>-e<\/code> \u9009\u9879\u542f\u52a8IDLE\uff0c\u5e76\u6253\u5f00\u4e00\u4e2a\u6307\u5b9a\u7684\u6587\u4ef6\u8fdb\u884c\u7f16\u8f91\u3002\n<pre><code class=\"language-bash\">idle -e example.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>-r<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u4f7f\u7528 <code>-r<\/code> \u9009\u9879\u542f\u52a8IDLE\uff0c\u5e76\u8fd0\u884c\u4e00\u4e2a\u6307\u5b9a\u7684\u811a\u672c\u6587\u4ef6\u3002\n<pre><code class=\"language-bash\">idle -r example.py<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h2>\u516b\u3001\u89e3\u51b3\u5e38\u89c1\u95ee\u9898\u4e0e\u6545\u969c\u6392\u9664<\/h2>\n<\/p>\n<p><p>\u5728\u542f\u52a8IDLE\u65f6\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u4e00\u4e9b\u5e38\u89c1\u95ee\u9898\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u89c1\u95ee\u9898\u7684\u89e3\u51b3\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>IDLE\u65e0\u6cd5\u542f\u52a8<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u5982\u679cIDLE\u65e0\u6cd5\u542f\u52a8\uff0c\u9996\u5148\u68c0\u67e5Python\u662f\u5426\u5df2\u6b63\u786e\u5b89\u88c5\uff0c\u5e76\u786e\u4fdd\u8def\u5f84\u5df2\u6dfb\u52a0\u5230\u73af\u5883\u53d8\u91cf\u4e2d\u3002<\/li>\n<li>\u5c1d\u8bd5\u901a\u8fc7Python\u5b89\u88c5\u76ee\u5f55\u542f\u52a8IDLE\uff0c\u6216\u8005\u901a\u8fc7\u56fe\u5f62\u7528\u6237\u754c\u9762\u542f\u52a8IDLE\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>IDLE\u542f\u52a8\u540e\u65e0\u54cd\u5e94<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u5982\u679cIDLE\u542f\u52a8\u540e\u65e0\u54cd\u5e94\uff0c\u5c1d\u8bd5\u4f7f\u7528 <code>-n<\/code> \u9009\u9879\u542f\u52a8IDLE\uff0c\u4ee5\u907f\u514d\u4f7f\u7528\u5b50\u8fdb\u7a0b\u3002<\/li>\n<li>\u68c0\u67e5\u7cfb\u7edf\u8d44\u6e90\u4f7f\u7528\u60c5\u51b5\uff0c\u786e\u4fdd\u6709\u8db3\u591f\u7684\u5185\u5b58\u548cCPU\u8d44\u6e90\u53ef\u7528\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>IDLE\u7a97\u53e3\u5e03\u5c40\u5f02\u5e38<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u5982\u679cIDLE\u7a97\u53e3\u5e03\u5c40\u5f02\u5e38\uff0c\u5c1d\u8bd5\u8c03\u6574\u7a97\u53e3\u5927\u5c0f\u6216\u91cd\u7f6e\u7a97\u53e3\u5e03\u5c40\u3002<\/li>\n<li>\u68c0\u67e5\u663e\u793a\u5668\u5206\u8fa8\u7387\u4e0e\u7f29\u653e\u8bbe\u7f6e\uff0c\u786e\u4fdd\u4e0eIDLE\u517c\u5bb9\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h2>\u4e5d\u3001IDLE\u7684\u57fa\u672c\u4f7f\u7528\u4e0e\u914d\u7f6e<\/h2>\n<\/p>\n<p><p>\u542f\u52a8IDLE\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u57fa\u672c\u64cd\u4f5c\u4e0e\u914d\u7f6e\u6765\u63d0\u9ad8\u4f7f\u7528\u6548\u7387\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u521b\u5efa\u4e0e\u7f16\u8f91Python\u811a\u672c<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u5728IDLE\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u201cFile\u201d\u83dc\u5355\u521b\u5efa\u6216\u6253\u5f00Python\u811a\u672c\u6587\u4ef6\u3002<\/li>\n<li>\u5728\u7f16\u8f91\u5668\u7a97\u53e3\u4e2d\u7f16\u5199Python\u4ee3\u7801\uff0c\u5e76\u4f7f\u7528\u5feb\u6377\u952e <code>Ctrl + S<\/code> \u4fdd\u5b58\u6587\u4ef6\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u8fd0\u884cPython\u811a\u672c<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u5728\u7f16\u8f91\u5668\u7a97\u53e3\u4e2d\u7f16\u5199\u4ee3\u7801\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u201cRun\u201d\u83dc\u5355\u9009\u62e9\u201cRun Module\u201d\u9009\u9879\uff0c\u6216\u8005\u6309\u4e0b\u5feb\u6377\u952e <code>F5<\/code> \u8fd0\u884c\u811a\u672c\u3002<\/li>\n<li>\u8fd0\u884c\u7ed3\u679c\u4f1a\u663e\u793a\u5728IDLE\u7684Shell\u7a97\u53e3\u4e2d\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u914d\u7f6eIDLE\u9009\u9879<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u901a\u8fc7\u201cOptions\u201d\u83dc\u5355\uff0c\u53ef\u4ee5\u914d\u7f6eIDLE\u7684\u663e\u793a\u3001\u7f16\u8f91\u548c\u8fd0\u884c\u9009\u9879\u3002<\/li>\n<li>\u5728\u201cConfigure IDLE\u201d\u5bf9\u8bdd\u6846\u4e2d\uff0c\u53ef\u4ee5\u8c03\u6574\u5b57\u4f53\u3001\u989c\u8272\u3001\u7f29\u8fdb\u7b49\u8bbe\u7f6e\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h2>\u5341\u3001IDLE\u7684\u9ad8\u7ea7\u529f\u80fd\u4e0e\u63d2\u4ef6<\/h2>\n<\/p>\n<p><p>\u9664\u4e86\u57fa\u672c\u529f\u80fd\u5916\uff0cIDLE\u8fd8\u63d0\u4f9b\u4e86\u4e00\u4e9b\u9ad8\u7ea7\u529f\u80fd\u4e0e\u63d2\u4ef6\uff0c\u5e2e\u52a9\u7528\u6237\u63d0\u9ad8\u5f00\u53d1\u6548\u7387\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p><strong>\u4ee3\u7801\u81ea\u52a8\u8865\u5168\u4e0e\u63d0\u793a<\/strong><\/p>\n<\/p>\n<ul>\n<li>IDLE\u63d0\u4f9b\u4ee3\u7801\u81ea\u52a8\u8865\u5168\u4e0e\u63d0\u793a\u529f\u80fd\uff0c\u5e2e\u52a9\u7528\u6237\u5feb\u901f\u7f16\u5199\u4ee3\u7801\u3002\u8f93\u5165\u90e8\u5206\u4ee3\u7801\u540e\uff0c\u6309\u4e0b <code>Tab<\/code> \u952e\u6216 <code>Ctrl + Space<\/code> \u53ef\u4ee5\u663e\u793a\u81ea\u52a8\u8865\u5168\u9009\u9879\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u8c03\u8bd5\u4e0e\u65ad\u70b9<\/strong><\/p>\n<\/p>\n<ul>\n<li>IDLE\u5185\u7f6e\u4e86\u8c03\u8bd5\u5668\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u65ad\u70b9\u5e76\u9010\u6b65\u6267\u884c\u4ee3\u7801\u3002\u901a\u8fc7\u201cDebug\u201d\u83dc\u5355\uff0c\u53ef\u4ee5\u542f\u52a8\u8c03\u8bd5\u5668\u5e76\u7ba1\u7406\u65ad\u70b9\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>\u6269\u5c55\u4e0e\u63d2\u4ef6<\/strong><\/p>\n<\/p>\n<ul>\n<li>IDLE\u652f\u6301\u901a\u8fc7\u6269\u5c55\u4e0e\u63d2\u4ef6\u589e\u5f3a\u529f\u80fd\u3002\u7528\u6237\u53ef\u4ee5\u7f16\u5199\u6216\u5b89\u88c5\u7b2c\u4e09\u65b9\u63d2\u4ef6\uff0c\u6dfb\u52a0\u65b0\u7684\u529f\u80fd\u4e0e\u7279\u6027\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h2>\u603b\u7ed3<\/h2>\n<\/p>\n<p><p>\u542f\u52a8Python\u89e3\u91ca\u5668\u81ea\u5e26\u7684IDLE\u5e76\u4e0d\u590d\u6742\u3002\u53ea\u9700\u6253\u5f00\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\uff0c\u8f93\u5165 <code>idle<\/code> \u547d\u4ee4\u5e76\u6309\u4e0b\u56de\u8f66\u952e\u5373\u53ef\u3002\u5982\u679c\u9047\u5230\u95ee\u9898\uff0c\u53ef\u4ee5\u68c0\u67e5Python\u8def\u5f84\u4e0e\u73af\u5883\u53d8\u91cf\uff0c\u6216\u8005\u901a\u8fc7\u56fe\u5f62\u7528\u6237\u754c\u9762\u542f\u52a8IDLE\u3002\u542f\u52a8\u540e\uff0c\u53ef\u4ee5\u901a\u8fc7\u914d\u7f6e\u9009\u9879\u3001\u4f7f\u7528\u9ad8\u7ea7\u529f\u80fd\u4e0e\u63d2\u4ef6\uff0c\u63d0\u9ad8\u5f00\u53d1\u6548\u7387\u4e0e\u4f53\u9a8c\u3002\u5e0c\u671b\u672c\u6587\u80fd\u5e2e\u52a9\u60a8\u987a\u5229\u542f\u52a8\u5e76\u4f7f\u7528IDLE\uff0c\u8fdb\u4e00\u6b65\u63d0\u5347Python\u7f16\u7a0b\u6280\u80fd\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728\u4e0d\u540c\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u542f\u52a8Python\u81ea\u5e26\u7684IDLE\uff1f<\/strong><br \/>\u5728Windows\u4e0a\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u5f00\u59cb\u83dc\u5355\u627e\u5230Python IDLE\uff0c\u901a\u5e38\u5728\u201cPython\u201d\u6587\u4ef6\u5939\u4e2d\u3002\u70b9\u51fb\u201cIDLE (Python 3.x)\u201d\u5373\u53ef\u542f\u52a8\u3002\u5728macOS\u4e0a\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7Launchpad\u627e\u5230Python IDLE\uff0c\u6216\u8005\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165<code>idle3<\/code>\u6765\u542f\u52a8\u3002\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u7ec8\u7aef\u8f93\u5165<code>idle<\/code>\u6216<code>idle3<\/code>\u547d\u4ee4\u6765\u542f\u52a8IDLE\u3002<\/p>\n<p><strong>\u542f\u52a8IDLE\u65f6\u9047\u5230\u95ee\u9898\u5e94\u8be5\u5982\u4f55\u89e3\u51b3\uff1f<\/strong><br \/>\u5982\u679c\u5728\u542f\u52a8IDLE\u65f6\u9047\u5230\u95ee\u9898\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u91cd\u65b0\u5b89\u88c5Python\uff0c\u786e\u4fdd\u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u52fe\u9009\u4e86\u201cAdd Python to PATH\u201d\u9009\u9879\u3002\u6b64\u5916\uff0c\u68c0\u67e5\u9632\u706b\u5899\u8bbe\u7f6e\u662f\u5426\u963b\u6b62\u4e86IDLE\u7684\u8fd0\u884c\u3002\u5982\u679c\u95ee\u9898\u4f9d\u65e7\u5b58\u5728\uff0c\u53ef\u4ee5\u67e5\u770bPython\u7684\u5b98\u65b9\u7f51\u7ad9\u6216\u793e\u533a\u8bba\u575b\u83b7\u53d6\u66f4\u591a\u652f\u6301\u3002<\/p>\n<p><strong>IDLE\u4e0e\u5176\u4ed6Python\u5f00\u53d1\u73af\u5883\u76f8\u6bd4\uff0c\u6709\u4ec0\u4e48\u4f18\u7f3a\u70b9\uff1f<\/strong><br \/>IDLE\u662fPython\u81ea\u5e26\u7684\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff0c\u7b80\u5355\u6613\u7528\uff0c\u975e\u5e38\u9002\u5408\u521d\u5b66\u8005\u3002\u5176\u4f18\u70b9\u5305\u62ec\u8f7b\u91cf\u7ea7\u3001\u65e0\u9700\u989d\u5916\u5b89\u88c5\u548c\u7b80\u5355\u7684\u754c\u9762\u3002\u7136\u800c\uff0c\u529f\u80fd\u76f8\u6bd4\u4e8e\u5982PyCharm\u6216VS Code\u7b49\u4e13\u4e1aIDE\u8f83\u4e3a\u6709\u9650\uff0c\u4e0d\u652f\u6301\u590d\u6742\u7684<a href=\"https:\/\/docs.pingcode.com\/blog\/project-management\/23316.html\" target=\"_blank\">\u9879\u76ee\u7ba1\u7406<\/a>\u548c\u5f3a\u5927\u7684\u8c03\u8bd5\u529f\u80fd\u3002\u5bf9\u4e8e\u521d\u5b66\u8005\u800c\u8a00\uff0cIDLE\u662f\u4e00\u4e2a\u4e0d\u9519\u7684\u8d77\u70b9\uff0c\u4f46\u968f\u7740\u6280\u80fd\u63d0\u5347\uff0c\u53ef\u80fd\u9700\u8981\u8003\u8651\u8f6c\u5411\u66f4\u9ad8\u7ea7\u7684\u5f00\u53d1\u73af\u5883\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8981\u542f\u52a8Python\u89e3\u91ca\u5668\u81ea\u5e26\u7684IDLE\uff0c\u53ef\u4ee5\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u64cd\u4f5c\uff1a\u6253\u5f00\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u3001\u8f93\u5165 &#39;idle&#038;#3 [&hellip;]","protected":false},"author":3,"featured_media":1052861,"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\/1052847"}],"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=1052847"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1052847\/revisions"}],"predecessor-version":[{"id":1052865,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1052847\/revisions\/1052865"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1052861"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1052847"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1052847"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1052847"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}