{"id":61907,"date":"2025-04-29T15:15:02","date_gmt":"2025-04-29T07:15:02","guid":{"rendered":"https:\/\/fwq.ai\/blog\/61907\/"},"modified":"2025-04-29T15:15:02","modified_gmt":"2025-04-29T07:15:02","slug":"linux%e4%b8%8b%e7%9a%84-py%e6%96%87%e4%bb%b6%e6%98%af%e4%bb%80%e4%b9%88-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/61907\/","title":{"rendered":"linux\u4e0b\u7684.py\u6587\u4ef6\u662f\u4ec0\u4e48"},"content":{"rendered":"<blockquote><p>\n  \u5728linux\u4e2d\uff0c&#8221;.py&#8221;\u662fpython\u6e90\u4ee3\u7801\u6587\u4ef6\u7684\u6269\u5c55\u540d\uff0c\u901a\u8fc7\u521b\u5efa\u548c\u8fd0\u884c.py\u6587\u4ef6\uff0c\u53ef\u4ee5\u5229\u7528python\u7684\u5f3a\u5927\u529f\u80fd\u6765\u7f16\u5199\u5404\u79cd\u7c7b\u578b\u7684\u5e94\u7528\u7a0b\u5e8f\uff0c\u5305\u62ec\u811a\u672c\u3001\u547d\u4ee4\u884c\u5de5\u5177\u3001web\u5e94\u7528\u7a0b\u5e8f\u3001\u6570\u636e\u5206\u6790\u548c\u673a\u5668\u5b66\u4e60\u6a21\u578b\u7b49\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202307\/24\/2023072410033267606.jpg\" class=\"aligncenter\" title=\"linux\u4e0b\u7684.py\u6587\u4ef6\u662f\u4ec0\u4e48\u63d2\u56fe\" alt=\"linux\u4e0b\u7684.py\u6587\u4ef6\u662f\u4ec0\u4e48\u63d2\u56fe\" \/><\/p>\n<p>\u672c\u6559\u7a0b\u64cd\u4f5c\u7cfb\u7edf\uff1aLinux5.18.14\u7cfb\u7edf\u3001Dell G3\u7535\u8111\u3002<\/p>\n<p><strong>\u5728Linux\u4e2d\uff0c&#8221;.py&#8221;\u662fPython\u6e90\u4ee3\u7801\u6587\u4ef6\u7684\u6269\u5c55\u540d\u3002Python\u662f\u4e00\u79cd\u9ad8\u7ea7\u7f16\u7a0b\u8bed\u8a00\uff0c\u5e7f\u6cdb\u7528\u4e8e\u5f00\u53d1\u5404\u79cd\u5e94\u7528\u7a0b\u5e8f\u548c\u811a\u672c\u3002Python\u6e90\u4ee3\u7801\u6587\u4ef6\u4f7f\u7528&#8221;.py&#8221;\u4f5c\u4e3a\u6587\u4ef6\u6269\u5c55\u540d\u3002<\/strong><\/p>\n<p>\u4e00\u4e2a.py\u6587\u4ef6\u5305\u542b\u4e86\u7528Python\u7f16\u5199\u7684\u6e90\u4ee3\u7801\u3002\u5b83\u53ef\u4ee5\u5305\u542b\u53d8\u91cf\u3001\u51fd\u6570\u3001\u7c7b\u7b49\u5b9a\u4e49\uff0c\u5e76\u53ef\u6267\u884c\u5404\u79cd\u64cd\u4f5c\u548c\u7b97\u6cd5\u3002Python\u6e90\u4ee3\u7801\u6587\u4ef6\u53ef\u4ee5\u901a\u8fc7Python\u89e3\u91ca\u5668\u6765\u6267\u884c\uff0c\u6216\u8005\u4f5c\u4e3a\u4e00\u4e2a\u6a21\u5757\u88ab\u5bfc\u5165\u5230\u5176\u4ed6Python\u811a\u672c\u4e2d\u4f7f\u7528\u3002<\/p>\n<p>\u521b\u5efa\u4e00\u4e2aPython\u6e90\u4ee3\u7801\u6587\u4ef6\u975e\u5e38\u7b80\u5355\u3002\u53ea\u9700\u5728Linux\u7ec8\u7aef\u6216\u6587\u672c\u7f16\u8f91\u5668\u4e2d\u521b\u5efa\u4e00\u4e2a\u65b0\u6587\u4ef6\uff0c\u5e76\u5c06\u5176\u547d\u540d\u4e3a\u5e0c\u671b\u7684\u540d\u79f0\uff0c\u5e76\u4f7f\u7528&#8221;.py&#8221;\u4f5c\u4e3a\u6587\u4ef6\u6269\u5c55\u540d\u3002\u7136\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\u7f16\u5199Python\u4ee3\u7801\uff0c\u5e76\u4fdd\u5b58\u5230\u8be5\u6587\u4ef6\u4e2d\u3002<\/p>\n<p>\u4f8b\u5982\uff0c\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a&#8221;hello.py&#8221;\u7684Python\u6e90\u4ee3\u7801\u6587\u4ef6\uff0c\u5176\u4e2d\u5305\u542b\u4e00\u4e2a\u7b80\u5355\u7684\u6253\u5370\u8bed\u53e5\uff1a<\/p>\n<pre>print(\"Hello,&nbsp;World!\")<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4fdd\u5b58\u8be5\u6587\u4ef6\u540e\uff0c\u5c31\u53ef\u4ee5\u5728Linux\u7ec8\u7aef\u4e0a\u6267\u884c\u8be5Python\u811a\u672c\uff0c\u65b9\u6cd5\u662f\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre>python&nbsp;hello.py<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8fd9\u5c06\u4f7f\u7528Python\u89e3\u91ca\u5668\u6267\u884c&#8221;hello.py&#8221;\u6587\u4ef6\uff0c\u5e76\u8f93\u51fa&#8221;Hello, World!&#8221;\u7684\u7ed3\u679c\u3002<\/p>\n<p>\u901a\u8fc7\u521b\u5efa\u548c\u8fd0\u884c.py\u6587\u4ef6\uff0c\u6211\u4eec\u53ef\u4ee5\u5229\u7528Python\u7684\u5f3a\u5927\u529f\u80fd\u6765\u7f16\u5199\u5404\u79cd\u7c7b\u578b\u7684\u5e94\u7528\u7a0b\u5e8f\uff0c\u5305\u62ec\u811a\u672c\u3001\u547d\u4ee4\u884c\u5de5\u5177\u3001Web\u5e94\u7528\u7a0b\u5e8f\u3001\u6570\u636e\u5206\u6790\u548c\u673a\u5668\u5b66\u4e60\u6a21\u578b\u7b49\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u4e0b\u7684.py\u6587\u4ef6\u662f\u4ec0\u4e48\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8FDCServers\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728linux\u4e2d\uff0c&#8221;.py&#8221;\u662fpython\u6e90\u4ee3\u7801\u6587\u4ef6\u7684\u6269\u5c55\u540d\uff0c\u901a\u8fc7\u521b\u5efa\u548c\u8fd0\u884c.py\u6587\u4ef6\uff0c\u53ef\u4ee5\u5229\u7528python\u7684\u5f3a\u5927\u529f\u80fd\u6765\u7f16\u5199\u5404\u79cd\u7c7b\u578b\u7684\u5e94\u7528\u7a0b\u5e8f\uff0c\u5305\u62ec\u811a\u672c\u3001\u547d\u4ee4\u884c\u5de5\u5177\u3001web\u5e94\u7528\u7a0b\u5e8f\u3001\u6570\u636e\u5206\u6790\u548c\u673a\u5668\u5b66\u4e60\u6a21\u578b\u7b49\u3002 \u672c\u6559\u7a0b\u64cd\u4f5c\u7cfb\u7edf\uff1aLinux5.18.14\u7cfb\u7edf\u3001Dell G3\u7535\u8111\u3002 \u5728Linux\u4e2d\uff0c&#8221;.py&#8221;\u662fPython\u6e90\u4ee3\u7801\u6587\u4ef6\u7684\u6269\u5c55\u540d\u3002Python\u662f\u4e00\u79cd\u9ad8\u7ea7\u7f16\u7a0b\u8bed\u8a00\uff0c\u5e7f\u6cdb\u7528\u4e8e\u5f00\u53d1\u5404\u79cd\u5e94\u7528\u7a0b\u5e8f\u548c\u811a\u672c\u3002Python\u6e90\u4ee3\u7801\u6587\u4ef6\u4f7f\u7528&#8221;.py&#8221;\u4f5c\u4e3a\u6587\u4ef6\u6269\u5c55\u540d\u3002 \u4e00\u4e2a.py\u6587\u4ef6\u5305\u542b\u4e86\u7528Python\u7f16\u5199\u7684\u6e90\u4ee3\u7801\u3002\u5b83\u53ef\u4ee5\u5305\u542b\u53d8\u91cf\u3001\u51fd\u6570\u3001\u7c7b\u7b49\u5b9a\u4e49\uff0c\u5e76\u53ef\u6267\u884c\u5404\u79cd\u64cd\u4f5c\u548c\u7b97\u6cd5\u3002Python\u6e90\u4ee3\u7801\u6587\u4ef6\u53ef\u4ee5\u901a\u8fc7Python\u89e3\u91ca\u5668\u6765\u6267\u884c\uff0c\u6216\u8005\u4f5c\u4e3a\u4e00\u4e2a\u6a21\u5757\u88ab\u5bfc\u5165\u5230\u5176\u4ed6Python\u811a\u672c\u4e2d\u4f7f\u7528\u3002 \u521b\u5efa\u4e00\u4e2aPython\u6e90\u4ee3\u7801\u6587\u4ef6\u975e\u5e38\u7b80\u5355\u3002\u53ea\u9700\u5728Linux\u7ec8\u7aef\u6216\u6587\u672c\u7f16\u8f91\u5668\u4e2d\u521b\u5efa\u4e00\u4e2a\u65b0\u6587\u4ef6\uff0c\u5e76\u5c06\u5176\u547d\u540d\u4e3a\u5e0c\u671b\u7684\u540d\u79f0\uff0c\u5e76\u4f7f\u7528&#8221;.py&#8221;\u4f5c\u4e3a\u6587\u4ef6\u6269\u5c55\u540d\u3002\u7136\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668\u7f16\u5199Python\u4ee3\u7801\uff0c\u5e76\u4fdd\u5b58\u5230\u8be5\u6587\u4ef6\u4e2d\u3002 \u4f8b\u5982\uff0c\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a&#8221;hello.py&#8221;\u7684Python\u6e90\u4ee3\u7801\u6587\u4ef6\uff0c\u5176\u4e2d\u5305\u542b\u4e00\u4e2a\u7b80\u5355\u7684\u6253\u5370\u8bed\u53e5\uff1a print(&#8220;Hello,&nbsp;World!&#8221;) \u767b\u5f55\u540e\u590d\u5236 \u4fdd\u5b58\u8be5\u6587\u4ef6\u540e\uff0c\u5c31\u53ef\u4ee5\u5728Linux\u7ec8\u7aef\u4e0a\u6267\u884c\u8be5Python\u811a\u672c\uff0c\u65b9\u6cd5\u662f\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a python&nbsp;hello.py \u767b\u5f55\u540e\u590d\u5236 \u8fd9\u5c06\u4f7f\u7528Python\u89e3\u91ca\u5668\u6267\u884c&#8221;hello.py&#8221;\u6587\u4ef6\uff0c\u5e76\u8f93\u51fa&#8221;Hello, World!&#8221;\u7684\u7ed3\u679c\u3002 \u901a\u8fc7\u521b\u5efa\u548c\u8fd0\u884c.py\u6587\u4ef6\uff0c\u6211\u4eec\u53ef\u4ee5\u5229\u7528Python\u7684\u5f3a\u5927\u529f\u80fd\u6765\u7f16\u5199\u5404\u79cd\u7c7b\u578b\u7684\u5e94\u7528\u7a0b\u5e8f\uff0c\u5305\u62ec\u811a\u672c\u3001\u547d\u4ee4\u884c\u5de5\u5177\u3001Web\u5e94\u7528\u7a0b\u5e8f\u3001\u6570\u636e\u5206\u6790\u548c\u673a\u5668\u5b66\u4e60\u6a21\u578b\u7b49\u3002 \u4ee5\u4e0a\u5c31\u662f\u4e0b\u7684.py\u6587\u4ef6\u662f\u4ec0\u4e48\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8FDCServers\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-61907","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/61907","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=61907"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/61907\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=61907"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=61907"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=61907"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}