{"id":224497,"date":"2024-05-11T19:41:38","date_gmt":"2024-05-11T11:41:38","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/224497.html"},"modified":"2024-05-11T19:41:43","modified_gmt":"2024-05-11T11:41:43","slug":"pycharm%e4%b8%ad%e5%a6%82%e4%bd%95%e5%83%8fspyder%e4%b8%80%e6%a0%b7%e6%89%a7%e8%a1%8c%e5%8d%95%e8%a1%8c%e4%bb%a3%e7%a0%81","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/224497.html","title":{"rendered":"pycharm\u4e2d\u5982\u4f55\u50cfspyder\u4e00\u6837\u6267\u884c\u5355\u884c\u4ee3\u7801"},"content":{"rendered":"<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25143844\/b8c05044-047d-4299-92dc-4a3d0ca0329a.webp\" alt=\"pycharm\u4e2d\u5982\u4f55\u50cfspyder\u4e00\u6837\u6267\u884c\u5355\u884c\u4ee3\u7801\" \/><\/p>\n<p><p>PyCharm\u4e2d\u53ef\u4ee5\u50cfSpyder\u4e00\u6837\u6267\u884c\u5355\u884c\u4ee3\u7801\uff0c\u4e3b\u8981\u65b9\u5f0f\u6709<strong>\u4f7f\u7528\u5feb\u6377\u952e\u3001\u4f7f\u7528Python\u63a7\u5236\u53f0\u3001\u8c03\u8bd5\u6a21\u5f0f\u4e0b\u7684\u9010\u884c\u6267\u884c<\/strong>\u3002\u4f8b\u5982\uff0c\u5728PyCharm\u4e2d\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u6309\u4e0b<strong>Alt+Shift+E<\/strong>\u5feb\u6377\u952e\u6765\u8fd0\u884c\u5f53\u524d\u5149\u6807\u6240\u5728\u7684\u5355\u884c\u4ee3\u7801\u3002\u6b64\u5916\uff0c\u901a\u8fc7\u5728<strong>Python\u63a7\u5236\u53f0<\/strong>\u4e2d\u590d\u5236\u7c98\u8d34\u5355\u884c\u4ee3\u7801\u6765\u6267\u884c\u4e5f\u662f\u4e00\u79cd\u65b9\u5f0f\u3002\u5728<strong>\u8c03\u8bd5\u6a21\u5f0f<\/strong>\u4e0b\uff0c\u53ef\u4ee5\u4f7f\u7528\u6b65\u8fdb\uff08Step Over\uff09\u529f\u80fd\u6765\u9010\u884c\u6267\u884c\u4ee3\u7801\u3002<\/p>\n<\/p>\n<p><p><strong>Python\u63a7\u5236\u53f0\u4e2d\u6267\u884c\u5355\u884c\u4ee3\u7801<\/strong><\/p>\n<\/p>\n<p><p>\u4e00\u3001\u4f7f\u7528Python\u63a7\u5236\u53f0<\/p>\n<\/p>\n<ol>\n<li>\u6253\u5f00Python\u63a7\u5236\u53f0<\/li>\n<\/ol>\n<p><p>\u5728PyCharm\u7684\u5e95\u90e8\u9762\u677f\u4e2d\uff0c\u70b9\u51fb\u201cPython\u63a7\u5236\u53f0\u201d\uff08\u6216\u201cTerminal\u201d\u65c1\u8fb9\u7684\u201cConsole\u201d\u9009\u9879\u5361\uff09\u3002\u8fd9\u4f1a\u6253\u5f00\u4e00\u4e2a\u4ea4\u4e92\u5f0f\u7684Python\u89e3\u91ca\u5668\u7a97\u53e3\uff0c\u7c7b\u4f3c\u4e8eSpyder\u7684IPython\u63a7\u5236\u53f0\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li>\u6267\u884c\u5355\u884c\u4ee3\u7801<\/li>\n<\/ol>\n<p><p>\u60a8\u53ef\u4ee5\u76f4\u63a5\u5728\u63a7\u5236\u53f0\u4e2d\u8f93\u5165\u4efb\u4f55Python\u547d\u4ee4\uff0c\u5e76\u6309Enter\u6765\u6267\u884c\u3002\u8fd9\u91cc\u7684\u64cd\u4f5c\u662f\u5373\u65f6\u7684\uff0c\u80fd\u591f\u7acb\u5373\u770b\u5230\u4ee3\u7801\u6267\u884c\u7684\u7ed3\u679c\uff0c\u975e\u5e38\u4fbf\u4e8e\u8c03\u8bd5\u548c\u6d4b\u8bd5\u5355\u884c\u4ee3\u7801\u7684\u6548\u679c\u3002<\/p>\n<\/p>\n<p><p>\u4e8c\u3001\u5feb\u6377\u65b9\u5f0f\u6267\u884c\u5355\u884c\u4ee3\u7801<\/p>\n<\/p>\n<ol>\n<li>\u9009\u62e9\u4ee3\u7801<\/li>\n<\/ol>\n<p><p>\u5728PyCharm\u7684\u4ee3\u7801\u7f16\u8f91\u5668\u4e2d\uff0c\u5c06\u5149\u6807\u653e\u7f6e\u4e8e\u60a8\u5e0c\u671b\u6267\u884c\u7684\u90a3\u4e00\u884c\u4ee3\u7801\u4e0a\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li>\u4f7f\u7528\u5feb\u6377\u952e<\/li>\n<\/ol>\n<p><p>\u6309\u4e0b<strong>Alt+Shift+E<\/strong>\uff0cPyCharm\u4f1a\u6267\u884c\u5f53\u524d\u884c\u7684\u4ee3\u7801\uff0c\u5e76\u5728\u5e95\u90e8\u7684\u201cRun\u201d\u7a97\u53e3\u4e2d\u663e\u793a\u7ed3\u679c\u3002\u8fd9\u79cd\u65b9\u5f0f\u662f\u5feb\u901f\u9a8c\u8bc1\u5355\u884c\u4ee3\u7801\u6548\u679c\u7684\u597d\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><p>\u4e09\u3001\u8c03\u8bd5\u6a21\u5f0f\u4e0b\u9010\u884c\u6267\u884c<\/p>\n<\/p>\n<ol>\n<li>\u8bbe\u7f6e\u65ad\u70b9<\/li>\n<\/ol>\n<p><p>\u5728\u60a8\u60f3\u8981\u5f00\u59cb\u9010\u884c\u6267\u884c\u7684\u4ee3\u7801\u884c\u5de6\u8fb9\u7684\u8fb9\u7f18\u70b9\u51fb\uff0c\u8bbe\u7f6e\u4e00\u4e2a\u65ad\u70b9\u3002\u65ad\u70b9\u5904\u4f1a\u51fa\u73b0\u7ea2\u70b9\uff0c\u4ee3\u7801\u8fd0\u884c\u65f6\u4f1a\u5728\u8fd9\u91cc\u6682\u505c\u3002<\/p>\n<\/p>\n<ol start=\"2\">\n<li>\u5f00\u59cb\u8c03\u8bd5<\/li>\n<\/ol>\n<p><p>\u70b9\u51fb\u9876\u90e8\u5de5\u5177\u680f\u7684\u201cDebug\u201d\u6309\u94ae\uff08\u4e00\u4e2a\u866b\u5b50\u7684\u56fe\u6807\uff09\u5f00\u59cb\u8c03\u8bd5\u4f1a\u8bdd\u3002\u7a0b\u5e8f\u4f1a\u8fd0\u884c\u5230\u7b2c\u4e00\u4e2a\u65ad\u70b9\u7136\u540e\u505c\u4e0b\u6765\u3002<\/p>\n<\/p>\n<ol start=\"3\">\n<li>\u9010\u884c\u6267\u884c<\/li>\n<\/ol>\n<p><p>\u73b0\u5728\u7a0b\u5e8f\u5df2\u7ecf\u6682\u505c\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u8c03\u8bd5\u5de5\u5177\u680f\u4e2d\u7684\u201cStep Over\u201d\u6309\u94ae\uff08\u6216\u6309F8\u952e\uff09\uff0c\u8fd9\u4f1a\u6267\u884c\u5f53\u524d\u884c\u7684\u4ee3\u7801\u5e76\u7acb\u5373\u8df3\u81f3\u4e0b\u4e00\u884c\u3002<\/p>\n<\/p>\n<p><p>\u6bcf\u4e00\u79cd\u65b9\u6cd5\u90fd\u80fd\u6709\u6548\u5730\u5728PyCharm\u4e2d\u6267\u884c\u5355\u884c\u4ee3\u7801\uff0c\u9009\u62e9\u54ea\u4e00\u79cd\u53d6\u51b3\u4e8e\u4e2a\u4eba\u7684\u5de5\u4f5c\u4e60\u60ef\u548c\u573a\u666f\u9700\u6c42\u3002\u5b66\u4f1a\u8fd9\u4e9b\u6280\u5de7\uff0c\u53ef\u4ee5\u63d0\u9ad8\u8c03\u8bd5\u6548\u7387\uff0c\u4e0eSpyder\u4e2d\u7684\u5355\u884c\u4ee3\u7801\u6267\u884c\u4f53\u9a8c\u76f8\u4f3c\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p><strong>1. \u5982\u4f55\u5728PyCharm\u4e2d\u6267\u884c\u5355\u884c\u4ee3\u7801\uff1f<\/strong><\/p>\n<p>\u5728PyCharm\u4e2d\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ea4\u4e92\u5f0fPython\u63a7\u5236\u53f0\u6765\u6267\u884c\u5355\u884c\u4ee3\u7801\uff0c\u7c7b\u4f3c\u4e8eSpyder\u4e2d\u7684\u529f\u80fd\u3002\u8981\u6267\u884c\u5355\u884c\u4ee3\u7801\uff0c\u8bf7\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u64cd\u4f5c\uff1a<\/p>\n<ul>\n<li>\u6253\u5f00PyCharm\u5e76\u6253\u5f00\u60a8\u7684Python\u9879\u76ee\u3002<\/li>\n<li>\u5728\u5e95\u90e8\u7684\u5de5\u5177\u680f\u4e2d\uff0c\u627e\u5230\u5e76\u6253\u5f00Python\u63a7\u5236\u53f0\u3002\u60a8\u53ef\u4ee5\u901a\u8fc7\u5355\u51fb\u5e95\u90e8\u680f\u4e2d\u7684Python\u56fe\u6807\u6216\u4f7f\u7528\u5feb\u6377\u952e\uff08\u901a\u5e38\u662fAlt + 5\uff09\u6765\u8bbf\u95ee\u5b83\u3002<\/li>\n<li>\u5728\u63a7\u5236\u53f0\u7a97\u53e3\u4e2d\uff0c\u952e\u5165\u8981\u6267\u884c\u7684Python\u4ee3\u7801\u5e76\u6309\u4e0bEnter\u952e\u3002\u4ee3\u7801\u5c06\u88ab\u7acb\u5373\u6267\u884c\uff0c\u5e76\u4e14\u60a8\u5c06\u5728\u63a7\u5236\u53f0\u4e2d\u770b\u5230\u7ed3\u679c\u3002<\/li>\n<\/ul>\n<p><strong>2. PyCharm\u4e2d\u6709\u6ca1\u6709\u7c7b\u4f3cSpyder\u7684\u5355\u884c\u4ee3\u7801\u6267\u884c\u529f\u80fd\uff1f<\/strong><\/p>\n<p>\u5bf9\u4e8e\u4e60\u60ef\u4f7f\u7528Spyder\u7684\u5f00\u53d1\u8005\uff0cPyCharm\u4e5f\u63d0\u4f9b\u4e86\u4e00\u79cd\u7c7b\u4f3c\u7684\u5355\u884c\u4ee3\u7801\u6267\u884c\u529f\u80fd\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528PyCharm\u7684\u201c\u6267\u884c\u9009\u62e9\u201d\u529f\u80fd\u6765\u6267\u884c\u5355\u884c\u4ee3\u7801\uff0c\u800c\u65e0\u9700\u6267\u884c\u6574\u4e2a\u7a0b\u5e8f\u3002\u8981\u4f7f\u7528\u8fd9\u4e2a\u529f\u80fd\uff0c\u8bf7\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u64cd\u4f5c\uff1a<\/p>\n<ul>\n<li>\u5728PyCharm\u4e2d\u6253\u5f00\u60a8\u7684Python\u9879\u76ee\u3002<\/li>\n<li>\u5728\u7f16\u8f91\u5668\u4e2d\u9009\u62e9\u8981\u6267\u884c\u7684\u4ee3\u7801\u884c\uff08\u6216\u8005\u4f7f\u7528\u9f20\u6807\u5149\u6807\u9009\u62e9\u591a\u884c\uff09\u3002<\/li>\n<li>\u53f3\u952e\u5355\u51fb\u6240\u9009\u4ee3\u7801\u884c\uff0c\u5e76\u9009\u62e9\u201c\u6267\u884c\u9009\u62e9\u201d\u9009\u9879\u3002<\/li>\n<li>\u6267\u884c\u7ed3\u679c\u5c06\u663e\u793a\u5728PyCharm\u7684\u63a7\u5236\u53f0\u7a97\u53e3\u4e2d\uff0c\u60a8\u53ef\u4ee5\u5728\u90a3\u91cc\u67e5\u770b\u8f93\u51fa\u7ed3\u679c\u3002<\/li>\n<\/ul>\n<p><strong>3. \u5982\u4f55\u5728PyCharm\u4e2d\u5feb\u901f\u6267\u884c\u5355\u884c\u4ee3\u7801\uff1f<\/strong><\/p>\n<p>PyCharm\u8fd8\u63d0\u4f9b\u4e86\u5feb\u901f\u6267\u884c\u5355\u884c\u4ee3\u7801\u7684\u65b9\u6cd5\uff0c\u53ef\u4ee5\u5e2e\u52a9\u60a8\u66f4\u9ad8\u6548\u5730\u8fdb\u884c\u5f00\u53d1\u3002\u4ee5\u4e0b\u662f\u60a8\u53ef\u4ee5\u4f7f\u7528\u7684\u4e00\u4e9b\u5feb\u6377\u952e\u548c\u64cd\u4f5c\u6765\u6267\u884c\u5355\u884c\u4ee3\u7801\uff1a<\/p>\n<ul>\n<li>\u5982\u679c\u60a8\u60f3\u8981\u5feb\u901f\u6267\u884c\u6574\u4e2aPython\u6587\u4ef6\uff0c\u8bf7\u4f7f\u7528\u5feb\u6377\u952e\u201cShift + Alt + F10\u201d\uff0c\u8fd9\u5c06\u4f7f\u7528\u9ed8\u8ba4\u8fd0\u884c\u914d\u7f6e\u6765\u8fd0\u884c\u6574\u4e2a\u6587\u4ef6\u3002<\/li>\n<li>\u5982\u679c\u60a8\u53ea\u60f3\u6267\u884c\u5f53\u524d\u5149\u6807\u4e0b\u7684\u5355\u884c\u4ee3\u7801\uff0c\u8bf7\u4f7f\u7528\u5feb\u6377\u952e\u201cShift + Enter\u201d\u3002\u4ee3\u7801\u5c06\u5728\u63a7\u5236\u53f0\u4e2d\u6267\u884c\uff0c\u5e76\u663e\u793a\u7ed3\u679c\u3002<\/li>\n<li>\u60a8\u8fd8\u53ef\u4ee5\u4f7f\u7528\u5feb\u6377\u952e\u201cCtrl + Shift + F10\u201d\u6765\u91cd\u65b0\u8fd0\u884c\u4e0a\u6b21\u8fd0\u884c\u7684\u914d\u7f6e\uff0c\u8fd9\u5bf9\u4e8e\u9891\u7e41\u6267\u884c\u540c\u4e00\u884c\u4ee3\u7801\u5f88\u65b9\u4fbf\u3002<\/li>\n<\/ul>\n<p>\u5e0c\u671b\u8fd9\u4e9b\u65b9\u6cd5\u53ef\u4ee5\u5e2e\u52a9\u60a8\u5728PyCharm\u4e2d\u50cf\u5728Spyder\u4e2d\u4e00\u6837\u8f7b\u677e\u6267\u884c\u5355\u884c\u4ee3\u7801\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"PyCharm\u4e2d\u53ef\u4ee5\u50cfSpyder\u4e00\u6837\u6267\u884c\u5355\u884c\u4ee3\u7801\uff0c\u4e3b\u8981\u65b9\u5f0f\u6709\u4f7f\u7528\u5feb\u6377\u952e\u3001\u4f7f\u7528Python\u63a7\u5236\u53f0\u3001\u8c03\u8bd5\u6a21\u5f0f\u4e0b\u7684 [&hellip;]","protected":false},"author":3,"featured_media":224506,"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\/224497"}],"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=224497"}],"version-history":[{"count":0,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/224497\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/224506"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=224497"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=224497"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=224497"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}