{"id":57,"date":"2024-02-25T06:38:51","date_gmt":"2024-02-24T22:38:51","guid":{"rendered":"http:\/\/www.uboger.com\/?p=57"},"modified":"2024-04-11T02:43:31","modified_gmt":"2024-04-10T18:43:31","slug":"%e5%9c%a8-windows-%e4%b8%8a%e5%ae%89%e8%a3%85-python-%e7%9a%84%e6%96%87%e5%ad%97%e6%95%99%e5%ad%a6","status":"publish","type":"post","link":"https:\/\/www.uboger.com\/?p=57","title":{"rendered":"\u6559\u4f60\u5982\u4f55\u5728 Windows \u4e0a\u5b89\u88c5 Python"},"content":{"rendered":"\n<p>Python \u662f\u4e00\u79cd\u6d41\u884c\u7684\u7f16\u7a0b\u8bed\u8a00\uff0c\u62e5\u6709\u5f3a\u5927\u7684\u751f\u6001\u7cfb\u7edf\u548c\u5e7f\u6cdb\u7684\u5e94\u7528\u9886\u57df\u3002\u5728 Windows \u4e0a\u5b89\u88c5 Python \u662f\u4e00\u9879\u7b80\u5355\u7684\u4efb\u52a1\uff0c\u4e0b\u9762\u662f\u8be6\u7ec6\u7684\u6b65\u9aa4\u6307\u5357\uff1a<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u6b65\u9aa4 1\uff1a\u4e0b\u8f7d Python \u5b89\u88c5\u7a0b\u5e8f<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u6253\u5f00\u6d4f\u89c8\u5668\uff0c\u8bbf\u95ee <a href=\"https:\/\/www.python.org\/downloads\/windows\/\">Python \u5b98\u65b9\u7f51\u7ad9<\/a>\u3002<\/li>\n\n\n\n<li>\u5728\u9875\u9762\u4e2d\u592e\u4f60\u4f1a\u770b\u5230\u4e00\u4e2a\u6700\u65b0\u7248\u672c\u7684 Python \u4e0b\u8f7d\u94fe\u63a5\uff0c\u70b9\u51fb\u5b83\u3002<\/li>\n\n\n\n<li>\u9875\u9762\u5c06\u6eda\u52a8\u81f3\u5e95\u90e8\uff0c\u4f60\u4f1a\u770b\u5230\u4e0d\u540c\u7248\u672c\u7684 Python \u5b89\u88c5\u7a0b\u5e8f\uff0c\u9009\u62e9\u9002\u5408\u4f60\u7cfb\u7edf\u7684\u7248\u672c\u3002\u901a\u5e38\uff0c\u4f60\u4f1a\u9009\u62e9\u4e0e\u4f60\u7684\u7cfb\u7edf\u67b6\u6784\uff0832 \u4f4d\u6216 64 \u4f4d\uff09\u5bf9\u5e94\u7684\u7248\u672c\u3002<\/li>\n\n\n\n<li>\u70b9\u51fb\u4e0b\u8f7d\u6309\u94ae\u5e76\u4fdd\u5b58\u5b89\u88c5\u7a0b\u5e8f\u5230\u4f60\u7684\u8ba1\u7b97\u673a\u3002<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">\u6b65\u9aa4 2\uff1a\u8fd0\u884c\u5b89\u88c5\u7a0b\u5e8f<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u627e\u5230\u4f60\u4e0b\u8f7d\u7684 Python \u5b89\u88c5\u7a0b\u5e8f\uff0c\u5e76\u53cc\u51fb\u8fd0\u884c\u5b83\u3002\u901a\u5e38\u5b83\u7684\u6587\u4ef6\u540d\u4e3a <code>python-{version}.exe<\/code>\uff0c\u5176\u4e2d <code>{version}<\/code> \u662f Python \u7684\u7248\u672c\u53f7\u3002<\/li>\n\n\n\n<li>\u5728\u5b89\u88c5\u7a0b\u5e8f\u754c\u9762\u4e2d\uff0c\u786e\u4fdd\u52fe\u9009\u4e86 &#8220;Add Python {version} to PATH&#8221; \u9009\u9879\uff0c\u8fd9\u5c06\u628a Python \u6dfb\u52a0\u5230\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\u4e2d\uff0c\u4f7f\u5f97\u4f60\u53ef\u4ee5\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u76f4\u63a5\u8fd0\u884c Python\u3002\u7136\u540e\u70b9\u51fb &#8220;Install Now&#8221;\u3002<\/li>\n\n\n\n<li>\u5b89\u88c5\u7a0b\u5e8f\u4f1a\u5f00\u59cb\u5b89\u88c5 Python\u3002\u7b49\u5f85\u5b89\u88c5\u5b8c\u6210\u3002<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">\u6b65\u9aa4 3\uff1a\u9a8c\u8bc1\u5b89\u88c5<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\uff08\u6309\u4e0b <code>Win + R<\/code> \u952e\uff0c\u8f93\u5165 <code>cmd<\/code> \u5e76\u6309\u4e0b\u56de\u8f66\uff09\u3002<\/li>\n\n\n\n<li>\u5728\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\u8f93\u5165 <code>python --version<\/code> \u5e76\u6309\u4e0b\u56de\u8f66\u3002\u5982\u679c\u4f60\u770b\u5230 Python \u7684\u7248\u672c\u53f7\uff0c\u5219\u8bf4\u660e\u5b89\u88c5\u6210\u529f\u3002<\/li>\n\n\n\n<li>\u4f60\u8fd8\u53ef\u4ee5\u8f93\u5165 <code>python<\/code> \u5e76\u6309\u4e0b\u56de\u8f66\uff0c\u8fdb\u5165 Python \u89e3\u91ca\u5668\u4ea4\u4e92\u6a21\u5f0f\u3002\u8f93\u5165 <code>print(\"Hello, World!\")<\/code> \u5e76\u6309\u4e0b\u56de\u8f66\uff0c\u5982\u679c\u4f60\u770b\u5230\u4e86 <code>Hello, World!<\/code> \u7684\u8f93\u51fa\uff0c\u5219\u8bf4\u660e Python \u5df2\u7ecf\u6b63\u786e\u5b89\u88c5\u5e76\u4e14\u53ef\u4ee5\u6b63\u5e38\u5de5\u4f5c\u3002<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">\u6b65\u9aa4 4\uff1a\u9009\u62e9\u7f16\u8f91\u5668\u6216\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08\u53ef\u9009\uff09<\/h3>\n\n\n\n<p>\u867d\u7136 Python \u81ea\u5e26\u4e86 IDLE \u7f16\u8f91\u5668\uff0c\u4f46\u4f60\u4e5f\u53ef\u4ee5\u9009\u62e9\u5b89\u88c5\u5176\u4ed6\u7f16\u8f91\u5668\u6216\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\u6765\u7f16\u5199 Python \u4ee3\u7801\uff0c\u4f8b\u5982\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/code.visualstudio.com\/\">Visual Studio Code<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.jetbrains.com\/pycharm\/\">PyCharm<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.sublimetext.com\/\">Sublime Text<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/atom.io\/\">Atom<\/a><\/li>\n\n\n\n<li>\u7b49\u7b49<\/li>\n<\/ul>\n\n\n\n<p>\u5b89\u88c5\u8fd9\u4e9b\u5de5\u5177\u901a\u5e38\u4e0e\u5b89\u88c5\u5176\u4ed6\u8f6f\u4ef6\u4e00\u6837\uff0c\u53ea\u9700\u4e0b\u8f7d\u5b89\u88c5\u7a0b\u5e8f\u5e76\u6309\u7167\u5176\u63d0\u793a\u8fdb\u884c\u64cd\u4f5c\u5373\u53ef\u3002<\/p>\n\n\n\n<p>\u81f3\u6b64\uff0c\u4f60\u5df2\u7ecf\u6210\u529f\u5728 Windows \u4e0a\u5b89\u88c5\u4e86 Python\uff0c\u5e76\u4e14\u53ef\u4ee5\u5f00\u59cb\u7f16\u5199\u548c\u8fd0\u884c Python \u7a0b\u5e8f\u4e86\u3002\u795d\u4f60\u7f16\u7a0b\u6109\u5feb\uff01<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" data-id=\"230\" src=\"http:\/\/www.uboger.com\/wp-content\/uploads\/2024\/04\/darkmind6176_A_cute_little_rabbit_IP_white_body_with_brown_ears_1c3d0a62-acf2-4293-93be-5da0298e296f-1024x574.png\" alt=\"\" class=\"wp-image-230\"\/><\/figure>\n<\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Python \u662f\u4e00\u79cd\u6d41\u884c\u7684\u7f16\u7a0b\u8bed&#46;&#46;&#46;<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[8],"tags":[5],"class_list":["post-57","post","type-post","status-publish","format-standard","hentry","category-app","tag-5"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.uboger.com\/index.php?rest_route=\/wp\/v2\/posts\/57","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.uboger.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.uboger.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.uboger.com\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.uboger.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=57"}],"version-history":[{"count":3,"href":"https:\/\/www.uboger.com\/index.php?rest_route=\/wp\/v2\/posts\/57\/revisions"}],"predecessor-version":[{"id":287,"href":"https:\/\/www.uboger.com\/index.php?rest_route=\/wp\/v2\/posts\/57\/revisions\/287"}],"wp:attachment":[{"href":"https:\/\/www.uboger.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=57"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.uboger.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=57"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.uboger.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=57"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}