{"id":24063,"date":"2025-04-19T09:21:17","date_gmt":"2025-04-19T01:21:17","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/24063.html"},"modified":"2025-04-19T09:21:17","modified_gmt":"2025-04-19T01:21:17","slug":"%e8%b7%9f%e6%88%91%e4%b8%80%e8%b5%b7%e5%ad%a6python%e6%95%b0%e6%8d%ae%e5%a4%84%e7%90%86%ef%bc%88125-127%ef%bc%89%ef%bc%9aipython%e8%bf%9b%e9%98%b6%e4%b8%8eaws%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%bd%bf","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/24063.html","title":{"rendered":"\u8ddf\u6211\u4e00\u8d77\u5b66Python\u6570\u636e\u5904\u7406\uff08125\/127\uff09\uff1aIPython\u8fdb\u9636\u4e0eAWS\u670d\u52a1\u5668\u4f7f\u7528\u5165\u95e8"},"content":{"rendered":"<h2>\u8ddf\u6211\u4e00\u8d77\u5b66Python\u6570\u636e\u5904\u7406&#xff08;125\/127&#xff09;&#xff1a;IPython\u8fdb\u9636\u4e0eAWS\u670d\u52a1\u5668\u4f7f\u7528\u5165\u95e8<\/h2>\n<p>\u5927\u5bb6\u597d\u5440&#xff01;\u6211\u4e00\u76f4\u89c9\u5f97\u5b66\u4e60\u662f\u4e00\u4ef6\u5f88\u6709\u8da3\u7684\u4e8b\u60c5&#xff0c;\u5c24\u5176\u662f\u5b66\u4e60Python\u6570\u636e\u5904\u7406&#xff0c;\u91cc\u9762\u6709\u597d\u591a\u5947\u5999\u7684\u77e5\u8bc6\u548c\u6280\u80fd\u3002\u6211\u7279\u522b\u60f3\u548c\u5927\u5bb6\u4e00\u8d77\u5206\u4eab\u8fd9\u4e9b\u5b66\u4e60\u8fc7\u7a0b\u4e2d\u7684\u6536\u83b7&#xff0c;\u5927\u5bb6\u4e00\u8d77\u8fdb\u6b65&#xff0c;\u5171\u540c\u63a2\u7d22Python\u6570\u636e\u5904\u7406\u7684\u7cbe\u5f69\u4e16\u754c\u3002\u4eca\u5929&#xff0c;\u54b1\u4eec\u63a5\u7740\u4e0a\u6b21\u7684\u5185\u5bb9&#xff0c;\u6df1\u5165\u5b66\u4e60IPython\u7684\u9b54\u6cd5\u547d\u4ee4&#xff0c;\u518d\u4e86\u89e3\u4e00\u4e0b\u5982\u4f55\u4f7f\u7528\u4e9a\u9a6c\u900a\u7f51\u7edc\u670d\u52a1&#xff08;AWS&#xff09;\u6765\u4e3a\u6570\u636e\u5904\u7406\u642d\u5efa\u670d\u52a1\u5668\u73af\u5883\u3002<\/p>\n<h3>\u4e00\u3001IPython\u9b54\u6cd5\u547d\u4ee4\u7684\u6df1\u5165\u63a2\u7d22<\/h3>\n<p>\u4e0a\u6b21\u6211\u4eec\u77e5\u9053\u4e86IPython\u6709\u5f88\u591a\u5b9e\u7528\u7684\u9b54\u6cd5\u51fd\u6570&#xff0c;\u5176\u5b9e\u5b83\u8fd8\u6709\u597d\u591a\u9b54\u6cd5\u547d\u4ee4&#xff08;https:\/\/ipython.org\/ipython-doc\/dev\/interactive\/magics.html &#xff09;\u3002\u8fd9\u4e9b\u547d\u4ee4\u7684\u7528\u5904\u53ef\u5927\u5566&#xff0c;\u5b83\u4eec\u80fd\u6839\u636e\u4f60\u5f00\u53d1\u65f6\u4f7f\u7528IPython\u7684\u65b9\u5f0f&#xff0c;\u5e2e\u4f60\u7b80\u5316\u5404\u79cd\u4efb\u52a1\u3002\u968f\u7740\u4f60\u7f16\u7a0b\u80fd\u529b\u8d8a\u6765\u8d8a\u5f3a&#xff0c;\u5b66\u4f1a\u7528\u8fd9\u4e9b\u9b54\u6cd5\u547d\u4ee4&#xff0c;\u80fd\u8ba9\u4f60\u7684\u5f00\u53d1\u8fc7\u7a0b\u66f4\u52a0\u9ad8\u6548\u3002<\/p>\n<p>\u6bd4\u5982\u8bf4&#xff0c;\u6211\u4eec\u5728\u5f00\u53d1\u4e2d\u7ecf\u5e38\u4f1a\u9047\u5230\u8fd9\u6837\u7684\u60c5\u51b5&#xff1a;\u5199\u4e86\u4e00\u5927\u6bb5\u4ee3\u7801&#xff0c;\u8fd0\u884c\u4e4b\u540e\u53d1\u73b0\u6709\u4e9b\u5730\u65b9\u4e0d\u5bf9&#xff0c;\u60f3\u8c03\u8bd5\u4e00\u4e0b\u3002\u8fd9\u65f6\u5019&#xff0c;\u201c%debug\u201d\u9b54\u6cd5\u547d\u4ee4\u5c31\u6d3e\u4e0a\u7528\u573a\u5566\u3002\u5047\u8bbe\u6211\u4eec\u5199\u4e86\u4e00\u4e2a\u7b80\u5355\u7684\u51fd\u6570\u6765\u8ba1\u7b97\u4e24\u4e2a\u6570\u7684\u548c&#xff0c;\u4f46\u5728\u8c03\u7528\u7684\u65f6\u5019\u51fa\u73b0\u4e86\u9519\u8bef&#xff1a;<\/p>\n<p><span class=\"token keyword\">def<\/span> <span class=\"token function\">add_numbers<\/span><span class=\"token punctuation\">(<\/span>a<span class=\"token punctuation\">,<\/span> b<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> a <span class=\"token operator\">&#043;<\/span> b<\/p>\n<p><span class=\"token keyword\">try<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    result <span class=\"token operator\">&#061;<\/span> add_numbers<span class=\"token punctuation\">(<\/span><span class=\"token number\">2<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#039;3&#039;<\/span><span class=\"token punctuation\">)<\/span>  <span class=\"token comment\"># \u6545\u610f\u4f20\u5165\u9519\u8bef\u7c7b\u578b\u7684\u6570\u636e<\/span><br \/>\n<span class=\"token keyword\">except<\/span> TypeError<span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token keyword\">pass<\/span><\/p>\n<p>\u5728\u666e\u901a\u7684Python\u73af\u5883\u91cc&#xff0c;\u62a5\u9519\u4e86\u53ef\u80fd\u4e0d\u592a\u5bb9\u6613\u5feb\u901f\u627e\u5230\u95ee\u9898\u3002\u4f46\u5728IPython\u91cc&#xff0c;\u6211\u4eec\u53ef\u4ee5\u5728\u62a5\u9519\u4e4b\u540e\u8f93\u5165\u201c%debug\u201d&#xff0c;\u5b83\u4f1a\u8fdb\u5165\u4ea4\u4e92\u5f0f\u8c03\u8bd5\u6a21\u5f0f&#xff0c;\u8ba9\u4f60\u53ef\u4ee5\u67e5\u770b\u4ee3\u7801\u6267\u884c\u7684\u6bcf\u4e00\u6b65&#xff0c;\u6e05\u695a\u5730\u770b\u5230\u54ea\u91cc\u51fa\u4e86\u95ee\u9898&#xff0c;\u662f\u53d8\u91cf\u7c7b\u578b\u4e0d\u5bf9&#xff0c;\u8fd8\u662f\u5176\u4ed6\u539f\u56e0\u3002\u8fd9\u5c31\u50cf\u7ed9\u6211\u4eec\u7684\u4ee3\u7801\u52a0\u4e86\u4e00\u4e2a\u201c\u900f\u89c6\u955c\u201d&#xff0c;\u80fd\u628a\u95ee\u9898\u770b\u5f97\u660e\u660e\u767d\u767d\u3002<\/p>\n<p>\u518d\u6bd4\u5982&#xff0c;\u201c%prun\u201d\u9b54\u6cd5\u547d\u4ee4\u53ef\u4ee5\u7528\u6765\u5206\u6790\u4ee3\u7801\u7684\u6027\u80fd\u3002\u5f53\u6211\u4eec\u5199\u4e86\u4e00\u4e2a\u7a0d\u5fae\u590d\u6742\u70b9\u7684\u51fd\u6570&#xff0c;\u60f3\u77e5\u9053\u5b83\u5728\u8fd0\u884c\u8fc7\u7a0b\u4e2d\u54ea\u4e9b\u90e8\u5206\u6bd4\u8f83\u8017\u65f6&#xff0c;\u5c31\u53ef\u4ee5\u7528\u8fd9\u4e2a\u547d\u4ee4\u3002\u5047\u8bbe\u6211\u4eec\u6709\u4e00\u4e2a\u51fd\u6570\u7528\u6765\u751f\u6210\u4e00\u4e2a\u5927\u5217\u8868&#xff0c;\u5e76\u4e14\u5bf9\u5217\u8868\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\u8fdb\u884c\u4e00\u4e9b\u7b80\u5355\u8ba1\u7b97&#xff1a;<\/p>\n<p><span class=\"token keyword\">def<\/span> <span class=\"token function\">complex_calculation<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    data <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span><br \/>\n    <span class=\"token keyword\">for<\/span> i <span class=\"token keyword\">in<\/span> <span class=\"token builtin\">range<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">10000<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n        value <span class=\"token operator\">&#061;<\/span> i <span class=\"token operator\">*<\/span> <span class=\"token number\">2<\/span> <span class=\"token operator\">&#043;<\/span> <span class=\"token number\">1<\/span><br \/>\n        data<span class=\"token punctuation\">.<\/span>append<span class=\"token punctuation\">(<\/span>value<span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> <span class=\"token builtin\">sum<\/span><span class=\"token punctuation\">(<\/span>data<span class=\"token punctuation\">)<\/span><\/p>\n<p>\u5728IPython\u91cc\u8f93\u5165\u201c%prun complex_calculation()\u201d&#xff0c;\u5b83\u4f1a\u8f93\u51fa\u8be6\u7ec6\u7684\u6027\u80fd\u5206\u6790\u62a5\u544a&#xff0c;\u544a\u8bc9\u4f60\u51fd\u6570\u91cc\u6bcf\u4e00\u884c\u4ee3\u7801\u6267\u884c\u7684\u6b21\u6570\u3001\u82b1\u8d39\u7684\u65f6\u95f4\u7b49\u4fe1\u606f\u3002\u901a\u8fc7\u8fd9\u4e9b\u4fe1\u606f&#xff0c;\u6211\u4eec\u5c31\u80fd\u77e5\u9053\u54ea\u4e9b\u5730\u65b9\u53ef\u4ee5\u4f18\u5316&#xff0c;\u8ba9\u4ee3\u7801\u8dd1\u5f97\u66f4\u5feb\u3002<\/p>\n<h3>\u4e8c\u3001AWS\u670d\u52a1\u5668\u7684\u542f\u52a8\u4e0e\u8bbe\u7f6e<\/h3>\n<p>\u5728\u6570\u636e\u5904\u7406\u4e2d&#xff0c;\u6709\u65f6\u5019\u6211\u4eec\u9700\u8981\u5f3a\u5927\u7684\u670d\u52a1\u5668\u8d44\u6e90\u3002AWS\u5c31\u662f\u4e00\u4e2a\u5f88\u5e38\u7528\u7684\u4e91\u670d\u52a1\u5e73\u53f0\u3002\u4e0d\u8fc7\u5728\u4f7f\u7528\u4e4b\u524d&#xff0c;\u6211\u4eec\u5f97\u5148\u628a\u670d\u52a1\u5668\u8bbe\u7f6e\u597d\u3002<\/p>\n<h4>&#xff08;\u4e00&#xff09;\u542f\u52a8AWS\u670d\u52a1\u5668<\/h4>\n<p>\u9996\u5148&#xff0c;\u6211\u4eec\u8981\u767b\u5f55\u5230AWS\u63a7\u5236\u53f0&#xff08;https:\/\/console.aws.amazon.com &#xff09;&#xff0c;\u5982\u679c\u4f60\u8fd8\u6ca1\u6709\u8d26\u53f7&#xff0c;\u5c31\u9700\u8981\u5148\u521b\u5efa\u4e00\u4e2a\u3002\u767b\u5f55\u4e4b\u540e&#xff0c;\u5728\u63a7\u5236\u53f0\u91cc\u627e\u5230\u201cCompute\u201d\u4e0b\u9762\u7684\u201cEC2\u201d\u9009\u9879&#xff0c;\u70b9\u51fb\u5b83\u5c31\u4f1a\u8fdb\u5165EC2\u7684\u7740\u9646\u9875&#xff08;https:\/\/console.aws.amazon.com\/ec2\/v2\/home &#xff09;\u3002\u5728\u8fd9\u91cc&#xff0c;\u6211\u4eec\u80fd\u770b\u5230\u4e00\u4e2a\u201cLaunch Instance\u201d\u6309\u94ae&#xff0c;\u70b9\u51fb\u5b83\u5c31\u53ef\u4ee5\u5f00\u59cb\u8bbe\u7f6e\u6211\u4eec\u7684\u670d\u52a1\u5668\u5b9e\u4f8b\u5566\u3002<\/p>\n<h4>&#xff08;\u4e8c&#xff09;\u9009\u62e9\u4e9a\u9a6c\u900a\u673a\u5668\u955c\u50cf&#xff08;AMI&#xff09;<\/h4>\n<p>\u63a5\u4e0b\u6765\u7684\u7b2c\u4e00\u6b65\u662f\u9009\u62e9\u4e00\u4e2a\u4e9a\u9a6c\u900a\u673a\u5668\u955c\u50cf&#xff08;AMI&#xff09;\u3002\u7b80\u5355\u6765\u8bf4&#xff0c;\u673a\u5668\u955c\u50cf\u5c31\u50cf\u662f\u670d\u52a1\u5668\u7684\u201c\u521d\u59cb\u88c5\u5907\u201d&#xff0c;\u5b83\u662f\u4e00\u4e2a\u64cd\u4f5c\u7cfb\u7edf\u7684\u955c\u50cf\u6216\u8005\u5feb\u7167\u3002\u6211\u4eec\u5e73\u65f6\u7528\u7684\u7535\u8111\u64cd\u4f5c\u7cfb\u7edf\u5e38\u89c1\u7684\u6709Windows\u548cOS X&#xff0c;\u4f46\u5728\u670d\u52a1\u5668\u9886\u57df&#xff0c;\u57fa\u4e8eLinux\u7684\u7cfb\u7edf\u7528\u5f97\u6bd4\u8f83\u591a\u3002\u8fd9\u91cc\u6211\u4eec\u63a8\u8350\u4f7f\u7528\u6700\u65b0\u7684Ubuntu\u7cfb\u7edf&#xff0c;\u5728\u5199\u8fd9\u7bc7\u6587\u7ae0\u7684\u65f6\u5019&#xff0c;\u7248\u672c\u662f\u201cUbuntu Server 14.04 LTS (HVM), SSD Volume Type &#8211; amid05e75b8\u201d \u3002\u9009\u8fd9\u4e2a\u7cfb\u7edf\u7684\u539f\u56e0\u662f\u5b83\u7a33\u5b9a\u3001\u514d\u8d39&#xff0c;\u800c\u4e14\u6709\u5f88\u591a\u5f00\u53d1\u8005\u5728\u7528&#xff0c;\u9047\u5230\u95ee\u9898\u4e5f\u5bb9\u6613\u627e\u5230\u89e3\u51b3\u529e\u6cd5\u3002<\/p>\n<h4>&#xff08;\u4e09&#xff09;\u9009\u62e9\u5b9e\u4f8b\u7c7b\u578b<\/h4>\n<p>\u9009\u597d\u955c\u50cf\u540e&#xff0c;\u5c31\u8981\u9009\u62e9\u5b9e\u4f8b\u7c7b\u578b\u4e86\u3002\u5b9e\u4f8b\u7c7b\u578b\u51b3\u5b9a\u4e86\u6211\u4eec\u542f\u52a8\u7684\u670d\u52a1\u5668\u7684\u201c\u80fd\u529b\u201d&#xff0c;\u6bd4\u5982\u5b83\u7684\u8ba1\u7b97\u80fd\u529b\u3001\u5185\u5b58\u5927\u5c0f\u7b49\u3002\u5bf9\u4e8e\u521a\u5f00\u59cb\u5b66\u4e60\u548c\u6d4b\u8bd5\u7684\u60c5\u51b5&#xff0c;\u6211\u4eec\u53ef\u4ee5\u9009\u62e9\u201ct2.micro (Free tier eligible)\u201d&#xff0c;\u8fd9\u4e2a\u7c7b\u578b\u662f\u514d\u8d39\u989d\u5ea6\u5185\u53ef\u4ee5\u4f7f\u7528\u7684\u3002\u9664\u975e\u4f60\u660e\u786e\u77e5\u9053\u81ea\u5df1\u9700\u8981\u66f4\u5f3a\u5927\u7684\u6027\u80fd&#xff0c;\u4e0d\u7136\u5148\u522b\u6269\u5bb9&#xff0c;\u4e0d\u7136\u53ef\u662f\u8981\u591a\u82b1\u94b1\u7684\u54e6\u3002\u8981\u662f\u4f60\u60f3\u4e86\u89e3\u66f4\u591a\u5173\u4e8e\u5b9e\u4f8b\u7c7b\u578b\u548c\u4ef7\u683c\u7684\u4fe1\u606f&#xff0c;\u53ef\u4ee5\u67e5\u770bAWS\u7684\u76f8\u5173\u6587\u7ae0&#xff08;https:\/\/aws.amazon.com\/ec2\/instance-types\/ \u3001https:\/\/aws.amazon.com\/ec2\/pricing\/ &#xff09;\u3002<\/p>\n<h4>&#xff08;\u56db&#xff09;\u5b9e\u4f8b\u542f\u52a8\u4e0e\u5b89\u5168\u8bbe\u7f6e<\/h4>\n<p>\u9009\u597d\u8fd9\u4e9b\u4e4b\u540e&#xff0c;\u70b9\u51fb\u201cReview and Launch\u201d\u5c31\u4f1a\u8fdb\u5165\u5230\u5b9e\u4f8b\u542f\u52a8\u7684\u6b65\u9aa4\u3002\u5728\u9875\u9762\u9876\u90e8&#xff0c;\u4f60\u53ef\u80fd\u4f1a\u770b\u5230\u4e00\u6761\u63d0\u793a\u4fe1\u606f&#xff0c;\u8bf4\u201c\u63d0\u9ad8\u4f60\u7684\u5b9e\u4f8b\u5b89\u5168\u3002\u4f60\u7684\u5b89\u5168\u7ec4&#xff0c;launchwizard &#8211; 4&#xff0c;\u6b63\u5bf9\u5168\u4e16\u754c\u5f00\u653e\u201d\u3002\u5982\u679c\u6211\u4eec\u7684\u670d\u52a1\u5668\u662f\u7528\u6765\u5b58\u653e\u91cd\u8981\u6570\u636e\u6216\u8005\u662f\u6b63\u5f0f\u4f7f\u7528\u7684\u4ea7\u54c1\u5b9e\u4f8b&#xff0c;\u90a3\u5c31\u4e00\u5b9a\u8981\u91cd\u89c6\u5b89\u5168\u95ee\u9898\u3002\u53ef\u4ee5\u67e5\u770bAWS\u7684\u6587\u7ae0\u201c\u52a0\u5f3a\u4f60\u7684EC2\u5b9e\u4f8b\u5b89\u5168\u7684\u5efa\u8bae\u201d&#xff08;https:\/\/aws.amazon.com\/articles\/1233\/ &#xff09;&#xff0c;\u6309\u7167\u91cc\u9762\u7684\u65b9\u6cd5\u6765\u63d0\u9ad8\u5b89\u5168\u6027\u3002<\/p>\n<h4>&#xff08;\u4e94&#xff09;\u9009\u62e9\u6216\u521b\u5efa\u952e\u5bf9<\/h4>\n<p>\u8fd8\u6709\u4e00\u4e2a\u5f88\u91cd\u8981\u7684\u6b65\u9aa4\u662f\u9009\u62e9\u4e00\u4e2a\u5b58\u5728\u7684\u952e\u5bf9\u6216\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u3002\u952e\u5bf9\u5c31\u50cf\u662f\u670d\u52a1\u5668\u7684\u201c\u94a5\u5319\u201d&#xff0c;\u6709\u4e86\u5b83&#xff0c;\u670d\u52a1\u5668\u624d\u77e5\u9053\u8c01\u6709\u6743\u9650\u4f7f\u7528\u5b83\u3002\u6211\u4eec\u9009\u62e9\u201cCreate a new key pair\u201d&#xff0c;\u7136\u540e\u7ed9\u5b83\u53d6\u4e2a\u5bb9\u6613\u8bb0\u4f4f\u7684\u540d\u5b57&#xff0c;\u6bd4\u5982\u201cmy_data_processing_key\u201d \u3002\u53d6\u597d\u540d\u5b57\u540e&#xff0c;\u70b9\u51fb\u521b\u5efa&#xff0c;\u63a5\u7740\u8981\u628a\u751f\u6210\u7684\u952e\u5bf9\u4e0b\u8f7d\u5230\u4e00\u4e2a\u4f60\u80fd\u627e\u5230\u7684\u5730\u65b9&#xff0c;\u8fd9\u53ef\u662f\u767b\u5f55\u670d\u52a1\u5668\u7684\u91cd\u8981\u51ed\u8bc1\u54e6\u3002\u6700\u540e&#xff0c;\u70b9\u51fb\u201cLaunch Instances\u201d&#xff0c;\u7b49\u5b9e\u4f8b\u542f\u52a8\u540e&#xff0c;\u4f60\u5c31\u80fd\u5728\u5c4f\u5e55\u4e0a\u770b\u5230\u4e00\u4e2a\u5b9e\u4f8bID\u5566\u3002<\/p>\n<p>\u8981\u662f\u4f60\u62c5\u5fc3\u670d\u52a1\u5668\u7684\u8d39\u7528\u95ee\u9898&#xff0c;\u8fd8\u53ef\u4ee5\u5728AWS\u9996\u9009\u9879\u4e2d\u521b\u5efa\u4e00\u4e2a\u8d26\u5355\u62a5\u8b66&#xff08;https:\/\/console.aws.amazon.com\/billing\/home?#\/preferences &#xff09;&#xff0c;\u8fd9\u6837\u5f53\u8d39\u7528\u5feb\u8fbe\u5230\u4f60\u8bbe\u5b9a\u7684\u9650\u989d\u65f6&#xff0c;\u5c31\u4f1a\u6536\u5230\u63d0\u9192&#xff0c;\u907f\u514d\u8d85\u652f\u3002<\/p>\n<h3>\u4e09\u3001\u767b\u5f55AWS\u670d\u52a1\u5668<\/h3>\n<p>\u670d\u52a1\u5668\u542f\u52a8\u597d\u4e86&#xff0c;\u63a5\u4e0b\u6765\u5c31\u662f\u767b\u5f55\u5230\u670d\u52a1\u5668\u4e0a\u8fdb\u884c\u64cd\u4f5c\u5566\u3002\u6211\u4eec\u8fd8\u662f\u8981\u56de\u5230AWS\u63a7\u5236\u53f0&#xff0c;\u9009\u62e9EC2&#xff0c;\u7136\u540e\u5728\u201cRunning Instances\u201d\u91cc\u627e\u5230\u6211\u4eec\u521a\u521a\u542f\u52a8\u7684\u5b9e\u4f8b&#xff08;\u5982\u679c\u6709\u591a\u4e2a\u5b9e\u4f8b&#xff0c;\u8fd9\u91cc\u7684\u6570\u5b57\u4f1a\u53d8\u5316&#xff09;\u3002\u8fd9\u65f6\u5019\u4f60\u53ef\u80fd\u4f1a\u53d1\u73b0&#xff0c;\u670d\u52a1\u5668\u8fd8\u6ca1\u6709\u540d\u5b57&#xff0c;\u4e0d\u592a\u597d\u533a\u5206\u3002\u6ca1\u5173\u7cfb&#xff0c;\u6211\u4eec\u53ef\u4ee5\u70b9\u51fb\u5217\u8868\u4e0a\u7684\u7a7a\u6846&#xff0c;\u7ed9\u5b83\u53d6\u4e2a\u540d\u5b57&#xff0c;\u6bd4\u5982\u201cmy_data_server\u201d&#xff0c;\u8fd9\u6837\u4ee5\u540e\u627e\u8d77\u6765\u5c31\u65b9\u4fbf\u591a\u4e86\u3002<\/p>\n<p>\u767b\u5f55\u670d\u52a1\u5668\u7684\u5177\u4f53\u64cd\u4f5c&#xff0c;\u6211\u4eec\u53ef\u4ee5\u53c2\u8003AWS\u5173\u4e8e\u8fde\u63a5\u5230Linux\u5b9e\u4f8b\u7684\u6587\u7ae0&#xff08;http:\/\/docs.aws.amazon.com\/AWSEC2\/latest\/UserGuide\/EC2_GetStarted.html#ec2-connect-toinstance-linux &#xff09;&#xff0c;\u6309\u7167\u91cc\u9762\u7684\u6307\u793a\u4e00\u6b65\u4e00\u6b65\u6765&#xff0c;\u5c31\u80fd\u987a\u5229\u767b\u5f55\u5230\u670d\u52a1\u5668\u4e0a&#xff0c;\u5f00\u59cb\u6211\u4eec\u7684\u6570\u636e\u5904\u7406\u4e4b\u65c5\u5566\u3002<\/p>\n<p>\u4eca\u5929\u7ed9\u5927\u5bb6\u5206\u4eab\u4e86IPython\u9b54\u6cd5\u547d\u4ee4\u7684\u4e00\u4e9b\u8fdb\u9636\u77e5\u8bc6&#xff0c;\u8fd8\u6709AWS\u670d\u52a1\u5668\u7684\u542f\u52a8\u548c\u767b\u5f55\u65b9\u6cd5\u3002\u8fd9\u4e9b\u77e5\u8bc6\u5728Python\u6570\u636e\u5904\u7406\u4e2d\u90fd\u975e\u5e38\u5b9e\u7528&#xff0c;\u5e0c\u671b\u5927\u5bb6\u90fd\u80fd\u52a8\u624b\u8bd5\u8bd5&#xff0c;\u52a0\u6df1\u7406\u89e3\u3002<\/p>\n<p>\u5199\u4f5c\u4e0d\u6613&#xff0c;\u5982\u679c\u8fd9\u7bc7\u6587\u7ae0\u5bf9\u4f60\u6709\u5e2e\u52a9&#xff0c;\u5e0c\u671b\u5927\u5bb6\u80fd\u5173\u6ce8\u6211\u7684\u535a\u5ba2&#xff0c;\u7ed9\u6587\u7ae0\u70b9\u4e2a\u8d5e&#xff0c;\u4e5f\u6b22\u8fce\u5927\u5bb6\u5728\u8bc4\u8bba\u533a\u7559\u8a00&#xff0c;\u5206\u4eab\u4f60\u7684\u5b66\u4e60\u5fc3\u5f97\u548c\u9047\u5230\u7684\u95ee\u9898&#xff0c;\u54b1\u4eec\u4e00\u8d77\u4ea4\u6d41&#xff0c;\u5171\u540c\u8fdb\u6b65&#xff01;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e5\u6b21\uff0c\u6536\u85cf19\u6b21\u3002\u5927\u5bb6\u597d\u5440\uff01\u6211\u4e00\u76f4\u89c9\u5f97\u5b66\u4e60\u662f\u4e00\u4ef6\u5f88\u6709\u8da3\u7684\u4e8b\u60c5\uff0c\u5c24\u5176\u662f\u5b66\u4e60Python\u6570\u636e\u5904\u7406\uff0c\u91cc\u9762\u6709\u597d\u591a\u5947\u5999\u7684\u77e5\u8bc6\u548c\u6280\u80fd\u3002\u6211\u7279\u522b\u60f3\u548c\u5927\u5bb6\u4e00\u8d77\u5206\u4eab\u8fd9\u4e9b\u5b66\u4e60\u8fc7\u7a0b\u4e2d\u7684\u6536\u83b7\uff0c\u5927\u5bb6\u4e00\u8d77\u8fdb\u6b65\uff0c\u5171\u540c\u63a2\u7d22Python\u6570\u636e\u5904\u7406\u7684\u7cbe\u5f69\u4e16\u754c\u3002\u4eca\u5929\uff0c\u54b1\u4eec\u63a5\u7740\u4e0a\u6b21\u7684\u5185\u5bb9\uff0c\u6df1\u5165\u5b66\u4e60IPython\u7684\u9b54\u6cd5\u547d\u4ee4\uff0c\u518d\u4e86\u89e3\u4e00\u4e0b\u5982\u4f55\u4f7f\u7528\u4e9a\u9a6c\u900a\u7f51\u7edc\u670d\u52a1\uff08AWS\uff09\u6765\u4e3a\u6570\u636e\u5904\u7406\u642d\u5efa\u670d\u52a1\u5668\u73af\u5883<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[1845,81,43,1844],"topic":[],"class_list":["post-24063","post","type-post","status-publish","format-standard","hentry","category-server","tag-ipython","tag-python","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u8ddf\u6211\u4e00\u8d77\u5b66Python\u6570\u636e\u5904\u7406\uff08125\/127\uff09\uff1aIPython\u8fdb\u9636\u4e0eAWS\u670d\u52a1\u5668\u4f7f\u7528\u5165\u95e8 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/24063.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u8ddf\u6211\u4e00\u8d77\u5b66Python\u6570\u636e\u5904\u7406\uff08125\/127\uff09\uff1aIPython\u8fdb\u9636\u4e0eAWS\u670d\u52a1\u5668\u4f7f\u7528\u5165\u95e8 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e5\u6b21\uff0c\u6536\u85cf19\u6b21\u3002\u5927\u5bb6\u597d\u5440\uff01\u6211\u4e00\u76f4\u89c9\u5f97\u5b66\u4e60\u662f\u4e00\u4ef6\u5f88\u6709\u8da3\u7684\u4e8b\u60c5\uff0c\u5c24\u5176\u662f\u5b66\u4e60Python\u6570\u636e\u5904\u7406\uff0c\u91cc\u9762\u6709\u597d\u591a\u5947\u5999\u7684\u77e5\u8bc6\u548c\u6280\u80fd\u3002\u6211\u7279\u522b\u60f3\u548c\u5927\u5bb6\u4e00\u8d77\u5206\u4eab\u8fd9\u4e9b\u5b66\u4e60\u8fc7\u7a0b\u4e2d\u7684\u6536\u83b7\uff0c\u5927\u5bb6\u4e00\u8d77\u8fdb\u6b65\uff0c\u5171\u540c\u63a2\u7d22Python\u6570\u636e\u5904\u7406\u7684\u7cbe\u5f69\u4e16\u754c\u3002\u4eca\u5929\uff0c\u54b1\u4eec\u63a5\u7740\u4e0a\u6b21\u7684\u5185\u5bb9\uff0c\u6df1\u5165\u5b66\u4e60IPython\u7684\u9b54\u6cd5\u547d\u4ee4\uff0c\u518d\u4e86\u89e3\u4e00\u4e0b\u5982\u4f55\u4f7f\u7528\u4e9a\u9a6c\u900a\u7f51\u7edc\u670d\u52a1\uff08AWS\uff09\u6765\u4e3a\u6570\u636e\u5904\u7406\u642d\u5efa\u670d\u52a1\u5668\u73af\u5883\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/24063.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-19T01:21:17+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/24063.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/24063.html\",\"name\":\"\u8ddf\u6211\u4e00\u8d77\u5b66Python\u6570\u636e\u5904\u7406\uff08125\/127\uff09\uff1aIPython\u8fdb\u9636\u4e0eAWS\u670d\u52a1\u5668\u4f7f\u7528\u5165\u95e8 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-19T01:21:17+00:00\",\"dateModified\":\"2025-04-19T01:21:17+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/24063.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/24063.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/24063.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u8ddf\u6211\u4e00\u8d77\u5b66Python\u6570\u636e\u5904\u7406\uff08125\/127\uff09\uff1aIPython\u8fdb\u9636\u4e0eAWS\u670d\u52a1\u5668\u4f7f\u7528\u5165\u95e8\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u8ddf\u6211\u4e00\u8d77\u5b66Python\u6570\u636e\u5904\u7406\uff08125\/127\uff09\uff1aIPython\u8fdb\u9636\u4e0eAWS\u670d\u52a1\u5668\u4f7f\u7528\u5165\u95e8 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/24063.html","og_locale":"zh_CN","og_type":"article","og_title":"\u8ddf\u6211\u4e00\u8d77\u5b66Python\u6570\u636e\u5904\u7406\uff08125\/127\uff09\uff1aIPython\u8fdb\u9636\u4e0eAWS\u670d\u52a1\u5668\u4f7f\u7528\u5165\u95e8 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1k\u6b21\uff0c\u70b9\u8d5e5\u6b21\uff0c\u6536\u85cf19\u6b21\u3002\u5927\u5bb6\u597d\u5440\uff01\u6211\u4e00\u76f4\u89c9\u5f97\u5b66\u4e60\u662f\u4e00\u4ef6\u5f88\u6709\u8da3\u7684\u4e8b\u60c5\uff0c\u5c24\u5176\u662f\u5b66\u4e60Python\u6570\u636e\u5904\u7406\uff0c\u91cc\u9762\u6709\u597d\u591a\u5947\u5999\u7684\u77e5\u8bc6\u548c\u6280\u80fd\u3002\u6211\u7279\u522b\u60f3\u548c\u5927\u5bb6\u4e00\u8d77\u5206\u4eab\u8fd9\u4e9b\u5b66\u4e60\u8fc7\u7a0b\u4e2d\u7684\u6536\u83b7\uff0c\u5927\u5bb6\u4e00\u8d77\u8fdb\u6b65\uff0c\u5171\u540c\u63a2\u7d22Python\u6570\u636e\u5904\u7406\u7684\u7cbe\u5f69\u4e16\u754c\u3002\u4eca\u5929\uff0c\u54b1\u4eec\u63a5\u7740\u4e0a\u6b21\u7684\u5185\u5bb9\uff0c\u6df1\u5165\u5b66\u4e60IPython\u7684\u9b54\u6cd5\u547d\u4ee4\uff0c\u518d\u4e86\u89e3\u4e00\u4e0b\u5982\u4f55\u4f7f\u7528\u4e9a\u9a6c\u900a\u7f51\u7edc\u670d\u52a1\uff08AWS\uff09\u6765\u4e3a\u6570\u636e\u5904\u7406\u642d\u5efa\u670d\u52a1\u5668\u73af\u5883","og_url":"https:\/\/www.wsisp.com\/helps\/24063.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-19T01:21:17+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/24063.html","url":"https:\/\/www.wsisp.com\/helps\/24063.html","name":"\u8ddf\u6211\u4e00\u8d77\u5b66Python\u6570\u636e\u5904\u7406\uff08125\/127\uff09\uff1aIPython\u8fdb\u9636\u4e0eAWS\u670d\u52a1\u5668\u4f7f\u7528\u5165\u95e8 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-19T01:21:17+00:00","dateModified":"2025-04-19T01:21:17+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/24063.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/24063.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/24063.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u8ddf\u6211\u4e00\u8d77\u5b66Python\u6570\u636e\u5904\u7406\uff08125\/127\uff09\uff1aIPython\u8fdb\u9636\u4e0eAWS\u670d\u52a1\u5668\u4f7f\u7528\u5165\u95e8"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/24063","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=24063"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/24063\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=24063"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=24063"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=24063"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=24063"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}