{"id":551485,"date":"2024-04-05T05:09:00","date_gmt":"2024-04-04T21:09:00","guid":{"rendered":"https:\/\/deepinout.com\/?p=551485"},"modified":"2024-03-31T10:11:51","modified_gmt":"2024-03-31T02:11:51","slug":"1694852087_j_how-to-run-python-program","status":"publish","type":"post","link":"https:\/\/deepinout.com\/python\/python-top-articles-python\/1694852087_j_how-to-run-python-program.html","title":{"rendered":"\u5982\u4f55\u8fd0\u884cPython\u7a0b\u5e8f"},"content":{"rendered":"<h2>\u5982\u4f55\u8fd0\u884cPython\u7a0b\u5e8f<\/h2>\n<p>Python\u7a0b\u5e8f\u5458\u5fc5\u987b\u4e86\u89e3\u8fd0\u884cPython\u811a\u672c\u6216\u4ee3\u7801\u7684\u6240\u6709\u53ef\u80fd\u65b9\u5f0f\u3002\u8fd9\u662f\u9a8c\u8bc1\u4ee3\u7801\u662f\u5426\u6309\u7167\u6211\u4eec\u7684\u671f\u671b\u5de5\u4f5c\u7684\u552f\u4e00\u65b9\u6cd5\u3002 Python\u89e3\u91ca\u5668\u8d1f\u8d23\u6267\u884cPython\u811a\u672c\u3002Python\u89e3\u91ca\u5668\u662f\u4e00\u79cd\u8f6f\u4ef6\uff0c\u5b83\u5728Python\u7a0b\u5e8f\u548c\u8ba1\u7b97\u673a\u786c\u4ef6\u4e4b\u95f4\u8d77\u4f5c\u7528\u3002\u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u5c06\u63cf\u8ff0\u8fd0\u884cPython\u811a\u672c\u7684\u4e00\u7cfb\u5217\u65b9\u6cd5\u3002<\/p>\n<ul>\n<li>\u64cd\u4f5c\u7cfb\u7edf\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\u3002<\/li>\n<li>Python\u4ea4\u4e92\u6a21\u5f0f\u3002<\/li>\n<li>IDE\u6216\u6587\u672c\u7f16\u8f91\u5668\u3002<\/li>\n<li>\u7cfb\u7edf\u7684\u6587\u4ef6\u7ba1\u7406\u5668\u3002<\/li>\n<\/ul>\n<h3>\u64cd\u4f5c\u7cfb\u7edf\u547d\u4ee4\u884c\u6216\u7ec8\u7aef<\/h3>\n<p>\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4\u884c\u6765\u8fd0\u884cPython\u4ee3\u7801\uff0c\u56e0\u4e3a\u5728<a href=\"https:\/\/deepinout.com\/python\/python-top-articles-python\/1694784044_j_python-tutorial.html\" data-internallinksmanager029f6b8e52c=\"1\" title=\"Python \u6559\u7a0b\" target=\"_blank\" rel=\"noopener\">Python<\/a> shell\u4e2d\uff0c\u4e00\u65e6\u5173\u95ed\u4f1a\u8bdd\uff0c\u6211\u4eec\u5c06\u4e22\u5931\u7f16\u5199\u7684\u5168\u90e8\u4ee3\u7801\u3002\u56e0\u6b64\uff0c\u6700\u597d\u4f7f\u7528\u7eaf\u6587\u672c\u6587\u4ef6\u7f16\u5199Python\u4ee3\u7801\u3002\u6587\u672c\u6587\u4ef6\u5fc5\u987b\u4fdd\u5b58\u4e3a <strong>.py<\/strong> \u6269\u5c55\u540d\u3002\u8ba9\u6211\u4eec\u770b\u4e0b\u9762\u7684\u793a\u4f8b\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/static.deepinout.com\/deepinout\/2024\/04\/04\/20240331101120-1.png\" alt=\"\u5982\u4f55\u8fd0\u884cPython\u7a0b\u5e8f\" title=\"\u5982\u4f55\u8fd0\u884cPython\u7a0b\u5e8f\" \/><\/p>\n<p>\u6211\u4eec\u7f16\u5199 <a href=\"https:\/\/deepinout.com\/python\/python-top-articles-python\/1694784044_j_python-tutorial.html\" data-internallinksmanager029f6b8e52c=\"1\" title=\"Python \u6559\u7a0b\" target=\"_blank\" rel=\"noopener\">Python<\/a> \u7684\u6253\u5370\u8bed\u53e5\u5e76\u5c06\u5176\u4fdd\u5b58\u4e3a <strong>sample.py<\/strong> \u5728\u5de5\u4f5c\u76ee\u5f55\u4e2d\u3002\u73b0\u5728\uff0c\u6211\u4eec\u5c06\u4f7f\u7528\u547d\u4ee4\u884c\u8fd0\u884c\u8fd9\u4e2a\u6587\u4ef6\u3002<\/p>\n<ul>\n<li><strong>\u4f7f\u7528 Python \u547d\u4ee4\u884c<\/strong><\/li>\n<\/ul>\n<p>\u6253\u5f00\u547d\u4ee4\u884c\u8fd0\u884c Python \u811a\u672c\u3002\u6211\u4eec\u9700\u8981\u8f93\u5165 <strong>python<\/strong> \uff0c\u7136\u540e\u662f\u6587\u4ef6\u540d\u6765\u6267\u884c\u6587\u4ef6\u3002\u73b0\u5728\uff0c\u6309\u4e0b\u56de\u8f66\u952e\uff0c\u5982\u679c\u6587\u4ef6\u4e2d\u6ca1\u6709\u9519\u8bef\uff0c\u6211\u4eec\u5c06\u4f1a\u770b\u5230\u4ee5\u4e0b\u8f93\u51fa\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/static.deepinout.com\/deepinout\/2024\/04\/04\/20240331101120-2.png\" alt=\"\u5982\u4f55\u8fd0\u884cPython\u7a0b\u5e8f\" title=\"\u5982\u4f55\u8fd0\u884cPython\u7a0b\u5e8f\" \/><\/p>\n<h3>Python\u4ea4\u4e92\u6a21\u5f0f<\/h3>\n<p>\u8981\u8fd0\u884cPython\u4ee3\u7801\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528Python\u4ea4\u4e92\u4f1a\u8bdd\u3002\u6211\u4eec\u9700\u8981\u5f00\u59cbPython\u4ea4\u4e92\u4f1a\u8bdd\uff0c\u53ea\u9700\u5728\u5f00\u59cb\u83dc\u5355\u4e2d\u6253\u5f00\u547d\u4ee4\u884c\u6216\u7ec8\u7aef\uff0c\u7136\u540e\u8f93\u5165python\uff0c\u6309\u4e0b\u56de\u8f66\u952e\u3002<\/p>\n<p>\u4e0b\u9762\u662f\u4f7f\u7528\u4ea4\u4e92\u5f0fshell\u8fd0\u884cPython\u4ee3\u7801\u7684\u793a\u4f8b\u3002<br \/>\n<img decoding=\"async\" src=\"https:\/\/static.deepinout.com\/deepinout\/2024\/04\/04\/20240331101120-3.png\" alt=\"\u5982\u4f55\u8fd0\u884cPython\u7a0b\u5e8f\" title=\"\u5982\u4f55\u8fd0\u884cPython\u7a0b\u5e8f\" \/><\/p>\n<p>\u5b83\u5141\u8bb8\u6211\u4eec\u68c0\u67e5\u6bcf\u4e00\u884c\u4ee3\u7801\uff0c\u5e76\u4e14\u8fd9\u4e2a\u529f\u80fd\u4f7f\u5176\u6210\u4e3a\u4e00\u4e2a\u4ee4\u4eba\u60ca\u559c\u7684\u5f00\u53d1\u5de5\u5177\u3002\u4f46\u662f\u4e00\u65e6\u6211\u4eec\u5173\u95ed\u4f1a\u8bdd\uff0c\u5b83\u5c06\u4e22\u5931\u6211\u4eec\u7f16\u5199\u7684\u6240\u6709\u4ee3\u7801\u3002<\/p>\n<p>\u4ee5\u4e0b\u662f\u9000\u51fa\u4ea4\u4e92\u6a21\u5f0f\u7684\u51e0\u79cd\u9009\u9879\uff1a<\/p>\n<ul>\n<li>\u8f93\u5165\u5185\u7f6e\u51fd\u6570 <strong>quit()<\/strong> \u6216 <strong>exit()<\/strong> \u3002\u6216<\/li>\n<li>\u8f93\u5165\u56de\u8f66\u952e <strong>ctrl+ Z<\/strong> \u7ec4\u5408\u952e\u6765\u7ed3\u675f\u5f53\u524d\u7684Python\u4ea4\u4e92\u6a21\u5f0f\u4f1a\u8bdd\u3002<\/li>\n<\/ul>\n<h3>IDE\u6216\u6587\u672c\u7f16\u8f91\u5668<\/h3>\n<p>IDE\u4ee3\u8868\u96c6\u6210\u5f00\u53d1\u73af\u5883\u3002\u6709\u5404\u79cdIDE\uff0c\u4f46 <strong>Pycharm<\/strong> \u662fPython\u4e2d\u6700\u53d7\u6b22\u8fce\u548c\u6709\u7528\u7684\u6587\u672c\u7f16\u8f91\u5668\u4e4b\u4e00\u3002\u5efa\u8bae\u7528\u4e8e\u5f00\u53d1\u5927\u578b\u548c\u66f4\u590d\u6742\u7684\u5e94\u7528\u7a0b\u5e8f\u3002\u6211\u4eec\u5728\u8fd9\u91cc\u4f7f\u7528 <strong>Pycharm<\/strong> \u6765\u8fd0\u884cPython\u811a\u672c\u3002<\/p>\n<p>\u521b\u5efa\u4e00\u4e2a\u65b0\u9879\u76ee\uff0c\u7136\u540e\u4f7f\u7528.py\u6269\u5c55\u540d\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Python\u6587\u4ef6\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/static.deepinout.com\/deepinout\/2024\/04\/04\/20240331101120-4.png\" alt=\"\u5982\u4f55\u8fd0\u884cPython\u7a0b\u5e8f\" title=\"\u5982\u4f55\u8fd0\u884cPython\u7a0b\u5e8f\" \/><\/p>\n<p>\u73b0\u5728\uff0c\u70b9\u51fb\u7eff\u8272\u6309\u94ae\uff0c\u5b83\u5c06\u663e\u793a\u4ee5\u4e0b\u8f93\u51fa\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/static.deepinout.com\/deepinout\/2024\/04\/04\/20240331101120-5.png\" alt=\"\u5982\u4f55\u8fd0\u884cPython\u7a0b\u5e8f\" title=\"\u5982\u4f55\u8fd0\u884cPython\u7a0b\u5e8f\" \/><\/p>\n<h3>\u6587\u4ef6\u7ba1\u7406\u7cfb\u7edf<\/h3>\n<p>Python\u6587\u4ef6\u53ef\u4ee5\u901a\u8fc7\u5728\u6587\u4ef6\u7ba1\u7406\u5668\u4e2d\u53cc\u51fb\u5176\u56fe\u6807\u6765\u8fd0\u884c\u3002\u8fd9\u4e2a\u8fc7\u7a0b\u5728\u5f00\u53d1\u9636\u6bb5\u53ef\u80fd\u5e76\u4e0d\u5e38\u7528\u3002\u5206\u522b\u5c06\u6587\u4ef6\u4e0e.py\u6216.pyw\u6269\u5c55\u540d\u76f8\u5173\u8054\uff0c\u4e0epython.exe\u7a0b\u5e8f\u5173\u8054\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u8fd0\u884cPython\u7a0b\u5e8f Python\u7a0b\u5e8f\u5458\u5fc5\u987b\u4e86\u89e3\u8fd0\u884cPython\u811a\u672c\u6216\u4ee3\u7801\u7684\u6240\u6709\u53ef\u80fd\u65b9\u5f0f\u3002\u8fd9\u662f\u9a8c\u8bc1\u4ee3\u7801\u662f\u5426\u6309\u7167\u6211\u4eec\u7684\u671f\u671b\u5de5\u4f5c\u7684\u552f\u4e00\u65b9\u6cd5\u3002 Python\u89e3\u91ca\u5668\u8d1f\u8d23\u6267\u884cPython\u811a\u672c\u3002Python\u89e3\u91ca\u5668\u662f\u4e00\u79cd\u8f6f\u4ef6\uff0c\u5b83\u5728Python\u7a0b\u5e8f\u548c\u8ba1 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[818],"tags":[],"_links":{"self":[{"href":"https:\/\/deepinout.com\/wp-json\/wp\/v2\/posts\/551485"}],"collection":[{"href":"https:\/\/deepinout.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/deepinout.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/deepinout.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/deepinout.com\/wp-json\/wp\/v2\/comments?post=551485"}],"version-history":[{"count":1,"href":"https:\/\/deepinout.com\/wp-json\/wp\/v2\/posts\/551485\/revisions"}],"predecessor-version":[{"id":551486,"href":"https:\/\/deepinout.com\/wp-json\/wp\/v2\/posts\/551485\/revisions\/551486"}],"wp:attachment":[{"href":"https:\/\/deepinout.com\/wp-json\/wp\/v2\/media?parent=551485"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/deepinout.com\/wp-json\/wp\/v2\/categories?post=551485"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/deepinout.com\/wp-json\/wp\/v2\/tags?post=551485"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}