{"id":1157555,"date":"2025-01-13T18:30:08","date_gmt":"2025-01-13T10:30:08","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/1157555.html"},"modified":"2025-01-13T18:30:11","modified_gmt":"2025-01-13T10:30:11","slug":"python%e7%bb%88%e7%ab%af%e7%aa%97%e5%8f%a3%e5%a6%82%e4%bd%95%e6%89%93%e5%bc%80","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/1157555.html","title":{"rendered":"python\u7ec8\u7aef\u7a97\u53e3\u5982\u4f55\u6253\u5f00"},"content":{"rendered":"<p style=\"text-align:center;\" ><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/25195735\/881b1f9b-cc6b-46f5-adcd-6af155274934.webp\" alt=\"python\u7ec8\u7aef\u7a97\u53e3\u5982\u4f55\u6253\u5f00\" \/><\/p>\n<p><p> \u8981\u5728\u7ec8\u7aef\u7a97\u53e3\u4e2d\u6253\u5f00Python\uff0c\u53ef\u4ee5\u4f7f\u7528<strong>\u591a\u79cd\u65b9\u6cd5<\/strong>\uff0c\u5305\u62ec<strong>\u76f4\u63a5\u8fd0\u884c\u547d\u4ee4<\/strong>\u3001<strong>\u4f7f\u7528\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09<\/strong>\u548c<strong>\u901a\u8fc7\u811a\u672c\u6587\u4ef6\u8fd0\u884c<\/strong>\u3002<strong>\u76f4\u63a5\u8fd0\u884c\u547d\u4ee4<\/strong>\u6700\u4e3a\u5e38\u89c1\u4e14\u4fbf\u6377\uff0c\u4e0b\u9762\u8be6\u7ec6\u4ecb\u7ecd\u8fd9\u4e00\u65b9\u6cd5\u3002<\/p>\n<\/p>\n<p><p><strong>\u76f4\u63a5\u8fd0\u884c\u547d\u4ee4<\/strong>\uff1a\u5728\u4f60\u7684\u64cd\u4f5c\u7cfb\u7edf\u7684\u7ec8\u7aef\u7a97\u53e3\u4e2d\u76f4\u63a5\u8f93\u5165<code>python<\/code>\u6216<code>python3<\/code>\u547d\u4ee4\uff0c\u5373\u53ef\u6253\u5f00Python\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668\u3002\u5728Mac\u548cLinux\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u6309\u4e0b<code>Ctrl+Alt+T<\/code>\u5feb\u6377\u952e\u6253\u5f00\u7ec8\u7aef\uff0c\u7136\u540e\u8f93\u5165\u547d\u4ee4\u3002\u5728Windows\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u641c\u7d22\u201ccmd\u201d\u6216\u201c\u547d\u4ee4\u63d0\u793a\u7b26\u201d\u6253\u5f00\u7ec8\u7aef\u7a97\u53e3\uff0c\u7136\u540e\u8f93\u5165\u547d\u4ee4\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001WINDOWS\u7cfb\u7edf<\/h3>\n<\/p>\n<p><h4>1\u3001\u4f7f\u7528\u547d\u4ee4\u63d0\u793a\u7b26<\/h4>\n<\/p>\n<p><p>\u5728Windows\u7cfb\u7edf\u4e2d\uff0c\u4f7f\u7528\u547d\u4ee4\u63d0\u793a\u7b26\uff08Command Prompt\uff09\u6253\u5f00Python\u975e\u5e38\u7b80\u5355\u3002\u4ee5\u4e0b\u662f\u5177\u4f53\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p>\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u6309\u4e0b<code>Win+R<\/code>\u952e\uff0c\u8f93\u5165<code>cmd<\/code>\uff0c\u6309\u56de\u8f66\u952e\u3002<\/li>\n<li>\u6216\u8005\u5728\u5f00\u59cb\u83dc\u5355\u4e2d\u641c\u7d22\u201c\u547d\u4ee4\u63d0\u793a\u7b26\u201d\u5e76\u6253\u5f00\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u8f93\u5165<code>python<\/code>\u6216<code>python3<\/code>\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u7a97\u53e3\u4e2d\uff0c\u8f93\u5165<code>python<\/code>\u6216<code>python3<\/code>\uff0c\u7136\u540e\u6309\u4e0b\u56de\u8f66\u952e\u3002<\/li>\n<li>\u5982\u679cPython\u5df2\u7ecf\u6b63\u786e\u5b89\u88c5\u5e76\u4e14\u7cfb\u7edf\u8def\u5f84\u5df2\u7ecf\u914d\u7f6e\u597d\uff0c\u4f60\u5e94\u8be5\u4f1a\u770b\u5230\u7c7b\u4f3c\u4e8e<code>&gt;&gt;&gt;<\/code>\u7684\u63d0\u793a\u7b26\uff0c\u8fd9\u8868\u793a\u4f60\u5df2\u7ecf\u8fdb\u5165\u4e86Python\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h4>2\u3001\u4f7f\u7528PowerShell<\/h4>\n<\/p>\n<p><p>PowerShell\u662f\u53e6\u4e00\u79cd\u5728Windows\u7cfb\u7edf\u4e2d\u6253\u5f00Python\u7684\u65b9\u6cd5\u3002\u4ee5\u4e0b\u662f\u5177\u4f53\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p>\u6253\u5f00PowerShell\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u6309\u4e0b<code>Win+X<\/code>\u952e\uff0c\u7136\u540e\u9009\u62e9\u201cWindows PowerShell\u201d\u3002<\/li>\n<li>\u6216\u8005\u5728\u5f00\u59cb\u83dc\u5355\u4e2d\u641c\u7d22\u201cPowerShell\u201d\u5e76\u6253\u5f00\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u8f93\u5165<code>python<\/code>\u6216<code>python3<\/code>\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u5728PowerShell\u7a97\u53e3\u4e2d\uff0c\u8f93\u5165<code>python<\/code>\u6216<code>python3<\/code>\uff0c\u7136\u540e\u6309\u4e0b\u56de\u8f66\u952e\u3002<\/li>\n<li>\u540c\u6837\uff0c\u5982\u679cPython\u5df2\u7ecf\u6b63\u786e\u5b89\u88c5\u5e76\u4e14\u7cfb\u7edf\u8def\u5f84\u5df2\u7ecf\u914d\u7f6e\u597d\uff0c\u4f60\u5e94\u8be5\u4f1a\u770b\u5230\u7c7b\u4f3c\u4e8e<code>&gt;&gt;&gt;<\/code>\u7684\u63d0\u793a\u7b26\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h3>\u4e8c\u3001MAC\u7cfb\u7edf<\/h3>\n<\/p>\n<p><h4>1\u3001\u4f7f\u7528\u7ec8\u7aef<\/h4>\n<\/p>\n<p><p>\u5728Mac\u7cfb\u7edf\u4e2d\uff0c\u4f7f\u7528\u7ec8\u7aef\u6253\u5f00Python\u4e5f\u662f\u975e\u5e38\u7b80\u5355\u7684\u3002\u4ee5\u4e0b\u662f\u5177\u4f53\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p>\u6253\u5f00\u7ec8\u7aef\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u6309\u4e0b<code>Command+Space<\/code>\u952e\uff0c\u8f93\u5165\u201c\u7ec8\u7aef\u201d\uff0c\u7136\u540e\u6309\u4e0b\u56de\u8f66\u952e\u3002<\/li>\n<li>\u6216\u8005\u5728\u5e94\u7528\u7a0b\u5e8f\u4e2d\u627e\u5230\u201c\u7ec8\u7aef\u201d\u5e76\u6253\u5f00\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u8f93\u5165<code>python<\/code>\u6216<code>python3<\/code>\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u5728\u7ec8\u7aef\u7a97\u53e3\u4e2d\uff0c\u8f93\u5165<code>python<\/code>\u6216<code>python3<\/code>\uff0c\u7136\u540e\u6309\u4e0b\u56de\u8f66\u952e\u3002<\/li>\n<li>\u5982\u679cPython\u5df2\u7ecf\u6b63\u786e\u5b89\u88c5\uff0c\u4f60\u5e94\u8be5\u4f1a\u770b\u5230\u7c7b\u4f3c\u4e8e<code>&gt;&gt;&gt;<\/code>\u7684\u63d0\u793a\u7b26\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h4>2\u3001\u4f7f\u7528iTerm2<\/h4>\n<\/p>\n<p><p>iTerm2\u662f\u4e00\u4e2a\u66f4\u5f3a\u5927\u7684\u7ec8\u7aef\u5e94\u7528\u7a0b\u5e8f\uff0c\u63d0\u4f9b\u4e86\u66f4\u591a\u529f\u80fd\u3002\u4ee5\u4e0b\u662f\u5177\u4f53\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p>\u4e0b\u8f7d\u5e76\u5b89\u88c5iTerm2\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u4eceiTerm2\u5b98\u7f51\uff08<a href=\"https:\/\/iterm2.com\/%EF%BC%89%E4%B8%8B%E8%BD%BD%E5%B9%B6%E5%AE%89%E8%A3%85iTerm2%E3%80%82\">https:\/\/iterm2.com\/\uff09\u4e0b\u8f7d\u5e76\u5b89\u88c5iTerm2\u3002<\/a><\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u6253\u5f00iTerm2\u5e76\u8f93\u5165<code>python<\/code>\u6216<code>python3<\/code>\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u6253\u5f00iTerm2\uff0c\u8f93\u5165<code>python<\/code>\u6216<code>python3<\/code>\uff0c\u7136\u540e\u6309\u4e0b\u56de\u8f66\u952e\u3002<\/li>\n<li>\u5982\u679cPython\u5df2\u7ecf\u6b63\u786e\u5b89\u88c5\uff0c\u4f60\u5e94\u8be5\u4f1a\u770b\u5230\u7c7b\u4f3c\u4e8e<code>&gt;&gt;&gt;<\/code>\u7684\u63d0\u793a\u7b26\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h3>\u4e09\u3001LINUX\u7cfb\u7edf<\/h3>\n<\/p>\n<p><h4>1\u3001\u4f7f\u7528\u7ec8\u7aef<\/h4>\n<\/p>\n<p><p>\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u4f7f\u7528\u7ec8\u7aef\u6253\u5f00Python\u4e5f\u662f\u975e\u5e38\u5e38\u89c1\u7684\u65b9\u6cd5\u3002\u4ee5\u4e0b\u662f\u5177\u4f53\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p>\u6253\u5f00\u7ec8\u7aef\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u6309\u4e0b<code>Ctrl+Alt+T<\/code>\u952e\uff0c\u6216\u8005\u5728\u5e94\u7528\u7a0b\u5e8f\u4e2d\u627e\u5230\u201c\u7ec8\u7aef\u201d\u5e76\u6253\u5f00\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u8f93\u5165<code>python<\/code>\u6216<code>python3<\/code>\u547d\u4ee4\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u5728\u7ec8\u7aef\u7a97\u53e3\u4e2d\uff0c\u8f93\u5165<code>python<\/code>\u6216<code>python3<\/code>\uff0c\u7136\u540e\u6309\u4e0b\u56de\u8f66\u952e\u3002<\/li>\n<li>\u5982\u679cPython\u5df2\u7ecf\u6b63\u786e\u5b89\u88c5\uff0c\u4f60\u5e94\u8be5\u4f1a\u770b\u5230\u7c7b\u4f3c\u4e8e<code>&gt;&gt;&gt;<\/code>\u7684\u63d0\u793a\u7b26\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h4>2\u3001\u4f7f\u7528\u5176\u4ed6\u7ec8\u7aef\u6a21\u62df\u5668<\/h4>\n<\/p>\n<p><p>\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u8fd8\u6709\u8bb8\u591a\u5176\u4ed6\u7ec8\u7aef\u6a21\u62df\u5668\u53ef\u4ee5\u4f7f\u7528\uff0c\u5982Terminator\u3001Konsole\u3001GNOME Terminal\u7b49\u3002\u4f7f\u7528\u8fd9\u4e9b\u7ec8\u7aef\u6a21\u62df\u5668\u7684\u6b65\u9aa4\u4e0e\u4e0a\u8ff0\u7ec8\u7aef\u7c7b\u4f3c\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u4f7f\u7528IDE\u6253\u5f00Python<\/h3>\n<\/p>\n<p><p>\u9664\u4e86\u76f4\u63a5\u5728\u7ec8\u7aef\u7a97\u53e3\u4e2d\u6253\u5f00Python\u5916\uff0c\u4f7f\u7528\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u4e5f\u662f\u4e00\u79cd\u5e38\u89c1\u7684\u65b9\u6cd5\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u6d41\u884c\u7684IDE\u53ca\u5176\u4f7f\u7528\u65b9\u6cd5\uff1a<\/p>\n<\/p>\n<p><h4>1\u3001PyCharm<\/h4>\n<\/p>\n<p><p>PyCharm\u662f\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u7684Python IDE\uff0c\u4ee5\u4e0b\u662f\u5177\u4f53\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p>\u4e0b\u8f7d\u5e76\u5b89\u88c5PyCharm\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u4ecePyCharm\u5b98\u7f51\uff08<a href=\"https:\/\/www.jetbrains.com\/pycharm\/%EF%BC%89%E4%B8%8B%E8%BD%BD%E5%B9%B6%E5%AE%89%E8%A3%85PyCharm%E3%80%82\">https:\/\/www.jetbr<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>ns.com\/pycharm\/\uff09\u4e0b\u8f7d\u5e76\u5b89\u88c5PyCharm\u3002<\/a><\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Python\u9879\u76ee\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u6253\u5f00PyCharm\uff0c\u9009\u62e9\u201cCreate New Project\u201d\u3002<\/li>\n<li>\u9009\u62e9Python\u89e3\u91ca\u5668\uff0c\u70b9\u51fb\u201cCreate\u201d\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u6253\u5f00Python\u4ea4\u4e92\u5f0f\u63a7\u5236\u53f0\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u5728PyCharm\u4e2d\uff0c\u70b9\u51fb\u201cView\u201d -&gt; \u201cTool Windows\u201d -&gt; \u201cPython Console\u201d\u3002<\/li>\n<li>\u8fd9\u5c06\u6253\u5f00Python\u4ea4\u4e92\u5f0f\u63a7\u5236\u53f0\uff0c\u4f60\u53ef\u4ee5\u5728\u5176\u4e2d\u8f93\u5165Python\u4ee3\u7801\u5e76\u7acb\u5373\u6267\u884c\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h4>2\u3001VS Code<\/h4>\n<\/p>\n<p><p>Visual Studio Code\uff08VS Code\uff09\u662f\u53e6\u4e00\u4e2a\u6d41\u884c\u7684Python IDE\uff0c\u4ee5\u4e0b\u662f\u5177\u4f53\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<ol>\n<li>\n<p>\u4e0b\u8f7d\u5e76\u5b89\u88c5VS Code\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u4eceVS Code\u5b98\u7f51\uff08<a href=\"https:\/\/code.visualstudio.com\/%EF%BC%89%E4%B8%8B%E8%BD%BD%E5%B9%B6%E5%AE%89%E8%A3%85VS\">https:\/\/code.visualstudio.com\/\uff09\u4e0b\u8f7d\u5e76\u5b89\u88c5VS<\/a> Code\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u5b89\u88c5Python\u6269\u5c55\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u6253\u5f00VS Code\uff0c\u70b9\u51fb\u5de6\u4fa7\u6269\u5c55\u56fe\u6807\uff0c\u641c\u7d22\u201cPython\u201d\uff0c\u70b9\u51fb\u201cInstall\u201d\u8fdb\u884c\u5b89\u88c5\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u6253\u5f00Python\u4ea4\u4e92\u5f0f\u63a7\u5236\u53f0\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u5728VS Code\u4e2d\uff0c\u6309\u4e0b<code>Ctrl+Shift+P<\/code>\uff0c\u8f93\u5165\u201cPython: Start REPL\u201d\uff0c\u7136\u540e\u6309\u4e0b\u56de\u8f66\u952e\u3002<\/li>\n<li>\u8fd9\u5c06\u6253\u5f00Python\u4ea4\u4e92\u5f0f\u63a7\u5236\u53f0\uff0c\u4f60\u53ef\u4ee5\u5728\u5176\u4e2d\u8f93\u5165Python\u4ee3\u7801\u5e76\u7acb\u5373\u6267\u884c\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h3>\u4e94\u3001\u901a\u8fc7\u811a\u672c\u6587\u4ef6\u8fd0\u884cPython<\/h3>\n<\/p>\n<p><p>\u9664\u4e86\u76f4\u63a5\u5728\u7ec8\u7aef\u7a97\u53e3\u4e2d\u6253\u5f00Python\u4ea4\u4e92\u5f0f\u89e3\u91ca\u5668\u5916\uff0c\u4f60\u8fd8\u53ef\u4ee5\u901a\u8fc7\u811a\u672c\u6587\u4ef6\u8fd0\u884cPython\u4ee3\u7801\u3002\u4ee5\u4e0b\u662f\u5177\u4f53\u6b65\u9aa4\uff1a<\/p>\n<\/p>\n<p><h4>1\u3001\u521b\u5efaPython\u811a\u672c\u6587\u4ef6<\/h4>\n<\/p>\n<ol>\n<li>\n<p>\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Python\u811a\u672c\u6587\u4ef6\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u6253\u5f00\u4f60\u559c\u6b22\u7684\u6587\u672c\u7f16\u8f91\u5668\uff08\u5982Notepad\u3001VS Code\u3001Sublime Text\u7b49\uff09\u3002<\/li>\n<li>\u8f93\u5165Python\u4ee3\u7801\uff0c\u5e76\u5c06\u6587\u4ef6\u4fdd\u5b58\u4e3a<code>.py<\/code>\u6269\u5c55\u540d\u3002\u4f8b\u5982\uff0c\u4fdd\u5b58\u4e3a<code>hello.py<\/code>\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n<\/p>\n<p><pre><code class=\"language-python\">print(&quot;Hello, World!&quot;)<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ol>\n<p><h4>2\u3001\u5728\u7ec8\u7aef\u7a97\u53e3\u4e2d\u8fd0\u884cPython\u811a\u672c\u6587\u4ef6<\/h4>\n<\/p>\n<ol>\n<li>\n<p>\u6253\u5f00\u7ec8\u7aef\u7a97\u53e3\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u5728Windows\u7cfb\u7edf\u4e2d\uff0c\u4f7f\u7528\u547d\u4ee4\u63d0\u793a\u7b26\u6216PowerShell\u3002<\/li>\n<li>\u5728Mac\u7cfb\u7edf\u4e2d\uff0c\u4f7f\u7528\u7ec8\u7aef\u6216iTerm2\u3002<\/li>\n<li>\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u4f7f\u7528\u7ec8\u7aef\u6216\u5176\u4ed6\u7ec8\u7aef\u6a21\u62df\u5668\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u5bfc\u822a\u5230\u811a\u672c\u6587\u4ef6\u6240\u5728\u76ee\u5f55\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u4f7f\u7528<code>cd<\/code>\u547d\u4ee4\u5bfc\u822a\u5230\u811a\u672c\u6587\u4ef6\u6240\u5728\u76ee\u5f55\u3002\u4f8b\u5982\uff0c\u5982\u679c\u811a\u672c\u6587\u4ef6\u4f4d\u4e8e\u684c\u9762\u76ee\u5f55\uff0c\u5219\u8f93\u5165\uff1a\n<pre><code class=\"language-bash\">cd ~\/Desktop<\/p>\n<p><\/code><\/pre>\n<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u8fd0\u884cPython\u811a\u672c\u6587\u4ef6\uff1a<\/p>\n<\/p>\n<ul>\n<li>\u8f93\u5165<code>python hello.py<\/code>\u6216<code>python3 hello.py<\/code>\uff0c\u7136\u540e\u6309\u4e0b\u56de\u8f66\u952e\u3002<\/li>\n<li>\u8fd9\u5c06\u8fd0\u884c\u811a\u672c\u6587\u4ef6\u4e2d\u7684\u4ee3\u7801\uff0c\u5e76\u5728\u7ec8\u7aef\u7a97\u53e3\u4e2d\u8f93\u51fa\u7ed3\u679c\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p><h3>\u516d\u3001\u603b\u7ed3<\/h3>\n<\/p>\n<p><p>\u6253\u5f00Python\u7ec8\u7aef\u7a97\u53e3\u7684\u65b9\u6cd5\u6709\u5f88\u591a\uff0c\u5305\u62ec\u4f7f\u7528\u547d\u4ee4\u63d0\u793a\u7b26\u3001PowerShell\u3001\u7ec8\u7aef\u3001iTerm2\u7b49\u3002\u5728Windows\u3001Mac\u548cLinux\u7cfb\u7edf\u4e2d\uff0c\u5404\u81ea\u6709\u4e0d\u540c\u7684\u6b65\u9aa4\u548c\u5de5\u5177\u3002\u6b64\u5916\uff0c\u8fd8\u53ef\u4ee5\u4f7f\u7528\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u5982PyCharm\u548cVS Code\u6765\u6253\u5f00Python\u4ea4\u4e92\u5f0f\u63a7\u5236\u53f0\uff0c\u6216\u8005\u901a\u8fc7\u811a\u672c\u6587\u4ef6\u8fd0\u884cPython\u4ee3\u7801\u3002\u65e0\u8bba\u4f60\u9009\u62e9\u54ea\u79cd\u65b9\u6cd5\uff0c\u786e\u4fddPython\u5df2\u7ecf\u6b63\u786e\u5b89\u88c5\u5e76\u4e14\u7cfb\u7edf\u8def\u5f84\u5df2\u7ecf\u914d\u7f6e\u597d\uff0c\u4ee5\u4fbf\u987a\u5229\u6253\u5f00Python\u7ec8\u7aef\u7a97\u53e3\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p> <strong>\u5982\u4f55\u5728Windows\u4e0a\u6253\u5f00Python\u7ec8\u7aef\u7a97\u53e3\uff1f<\/strong><br \/>\u5728Windows\u64cd\u4f5c\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u51e0\u79cd\u65b9\u5f0f\u6253\u5f00Python\u7ec8\u7aef\u7a97\u53e3\u3002\u6700\u5e38\u89c1\u7684\u65b9\u6cd5\u662f\u4f7f\u7528\u547d\u4ee4\u63d0\u793a\u7b26\u3002\u53ea\u9700\u6309\u4e0b\u201cWin + R\u201d\u7ec4\u5408\u952e\uff0c\u8f93\u5165\u201ccmd\u201d\u5e76\u6309\u56de\u8f66\u3002\u63a5\u7740\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u7a97\u53e3\u4e2d\u8f93\u5165\u201cpython\u201d\u6216\u201cpy\u201d\uff0c\u7136\u540e\u6309\u56de\u8f66\u3002\u5982\u679c\u5b89\u88c5\u6b63\u786e\uff0c\u4f60\u5c06\u8fdb\u5165Python\u7684\u4ea4\u4e92\u5f0f\u7ec8\u7aef\u3002\u6b64\u5916\uff0cWindows 10\u53ca\u4ee5\u4e0a\u7248\u672c\u53ef\u4ee5\u76f4\u63a5\u5728\u5f00\u59cb\u83dc\u5355\u4e2d\u641c\u7d22\u201cPython\u201d\uff0c\u9009\u62e9Python\u5e94\u7528\u7a0b\u5e8f\u4e5f\u80fd\u5feb\u901f\u6253\u5f00\u7ec8\u7aef\u3002<\/p>\n<p><strong>\u5728macOS\u4e0a\u5982\u4f55\u542f\u52a8Python\u7ec8\u7aef\uff1f<\/strong><br \/>\u5728macOS\u4e2d\uff0c\u6253\u5f00\u7ec8\u7aef\u975e\u5e38\u7b80\u5355\u3002\u53ef\u4ee5\u901a\u8fc7\u5728\u201c\u5e94\u7528\u7a0b\u5e8f\u201d\u6587\u4ef6\u5939\u4e2d\u627e\u5230\u201c\u5b9e\u7528\u5de5\u5177\u201d\uff0c\u7136\u540e\u53cc\u51fb\u201c\u7ec8\u7aef\u201d\u6765\u6253\u5f00\u3002\u4e5f\u53ef\u4ee5\u4f7f\u7528Spotlight\u641c\u7d22\uff08\u6309\u4e0bCommand + \u7a7a\u683c\u952e\uff09\uff0c\u8f93\u5165\u201cTerminal\u201d\u5e76\u9009\u62e9\u5b83\u3002\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165\u201cpython3\u201d\u6216\u201cpython\u201d\u5e76\u6309\u56de\u8f66\uff0c\u5c31\u53ef\u4ee5\u8fdb\u5165Python\u4ea4\u4e92\u5f0f\u73af\u5883\u3002<\/p>\n<p><strong>Linux\u7cfb\u7edf\u4e2d\u5982\u4f55\u8bbf\u95eePython\u7ec8\u7aef\u7a97\u53e3\uff1f<\/strong><br \/>\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u6253\u5f00\u7ec8\u7aef\u7a97\u53e3\u901a\u5e38\u53ef\u4ee5\u901a\u8fc7\u5feb\u6377\u952e\u201cCtrl + Alt + T\u201d\u6765\u5b9e\u73b0\u3002\u4e5f\u53ef\u4ee5\u5728\u5e94\u7528\u7a0b\u5e8f\u83dc\u5355\u4e2d\u627e\u5230\u201c\u7ec8\u7aef\u201d\u9009\u9879\u3002\u6253\u5f00\u7ec8\u7aef\u540e\uff0c\u8f93\u5165\u201cpython3\u201d\u6216\u201cpython\u201d\u5373\u53ef\u8fdb\u5165Python\u7684\u4ea4\u4e92\u6a21\u5f0f\u3002\u786e\u4fdd\u5df2\u5b89\u88c5Python\uff0c\u5982\u679c\u6ca1\u6709\uff0c\u53ef\u4ee5\u901a\u8fc7\u5305\u7ba1\u7406\u5668\u8f7b\u677e\u5b89\u88c5\uff0c\u4f8b\u5982\u4f7f\u7528\u547d\u4ee4\u201csudo apt-get install python3\u201d\u6765\u5b89\u88c5Python 3\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u8981\u5728\u7ec8\u7aef\u7a97\u53e3\u4e2d\u6253\u5f00Python\uff0c\u53ef\u4ee5\u4f7f\u7528\u591a\u79cd\u65b9\u6cd5\uff0c\u5305\u62ec\u76f4\u63a5\u8fd0\u884c\u547d\u4ee4\u3001\u4f7f\u7528\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u548c\u901a\u8fc7\u811a\u672c\u6587\u4ef6\u8fd0 [&hellip;]","protected":false},"author":3,"featured_media":1157563,"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\/1157555"}],"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=1157555"}],"version-history":[{"count":"1","href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1157555\/revisions"}],"predecessor-version":[{"id":1157565,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/1157555\/revisions\/1157565"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/1157563"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=1157555"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=1157555"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=1157555"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}