{"id":25085,"date":"2024-06-13T17:52:42","date_gmt":"2024-06-13T09:52:42","guid":{"rendered":"https:\/\/www.yimenyun.cn\/emen\/25085\/"},"modified":"2024-06-13T17:52:42","modified_gmt":"2024-06-13T09:52:42","slug":"%e4%b8%80%e9%94%ae%e7%94%9f%e6%88%90exe%e7%a8%8b%e5%ba%8f%e6%9c%89%e5%93%aa%e4%ba%9b%e6%96%b9%e6%b3%95%e5%91%a2","status":"publish","type":"post","link":"https:\/\/www.yimenyun.cn\/emen\/25085\/","title":{"rendered":"\u4e00\u952e\u751f\u6210exe\u7a0b\u5e8f\u6709\u54ea\u4e9b\u65b9\u6cd5\u5462?"},"content":{"rendered":"
\u4e00\u952e\u751f\u6210exe\u7a0b\u5e8f\u662f\u4e00\u79cd\u80fd\u591f\u5c06\u6e90\u4ee3\u7801\u81ea\u52a8\u7f16\u8bd1\u6210\u53ef\u6267\u884c\u6587\u4ef6\u7684\u5de5\u5177\u3002\u8fd9\u79cd\u5de5\u5177\u9002\u7528\u4e8e\u90a3\u4e9b\u4e0d\u719f\u6089\u7f16\u7a0b\u8bed\u8a00\u7684\u4eba\u5458\uff0c\u751a\u81f3\u8fde\u7f16\u8bd1\u5668\u90fd\u4e0d\u9700\u8981\u4e86\u89e3\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u4e00\u952e\u751f\u6210exe\u7a0b\u5e8f\u7684\u539f\u7406\u548c\u8be6\u7ec6\u6b65\u9aa4\u3002<\/p>\n
\u4e00\u3001\u539f\u7406<\/p>\n
\u4e00\u952e\u751f\u6210exe\u7a0b\u5e8f\u7684\u539f\u7406\u662f\u901a\u8fc7\u5c06\u6e90\u4ee3\u7801\u8f6c\u6362\u4e3a\u53ef\u6267\u884c\u6587\u4ef6\u7684\u8fc7\u7a0b\u6765\u5b9e\u73b0\u3002\u8fd9\u4e2a\u8fc7\u7a0b\u4e3b\u8981\u5305\u62ec\u4e09\u4e2a\u6b65\u9aa4\uff1a<\/p>\n
1.\u7f16\u8bd1\uff1a\u5c06\u6e90\u4ee3\u7801\u8f6c\u6362\u4e3a\u4e2d\u95f4\u4ee3\u7801\u3002<\/p>\n
2.\u94fe\u63a5\uff1a\u5c06\u4e2d\u95f4\u4ee3\u7801\u548c\u5e93\u6587\u4ef6\u94fe\u63a5\u6210\u53ef\u6267\u884c\u6587\u4ef6\u3002<\/p>\n
3.\u6253\u5305\uff1a\u5c06\u53ef\u6267\u884c\u6587\u4ef6\u548c\u6240\u9700\u7684\u8d44\u6e90\u6253\u5305\u6210\u4e00\u4e2a\u72ec\u7acb\u7684exe\u6587\u4ef6\u3002<\/p>\n
\u4e8c\u3001\u8be6\u7ec6\u6b65\u9aa4<\/p>\n
\u4e0b\u9762\u5c06\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528\u4e00\u952e\u751f\u6210exepc\u8f6f\u4ef6\u6253\u5305\u5de5\u5177<\/a>\u7a0b\u5e8f\uff0c\u4ee5Python\u4e3a\u4f8b\u3002<\/p>\n 1.\u5b89\u88c5Python\u548cPyInstaller<\/p>\n \u9996\u5148\uff0c\u9700\u8981\u5b89\u88c5Python\u548cPyInstaller\u3002Python\u662f\u4e00\u79cd\u6d41\u884c\u7684\u7f16\u7a0b\u8bed\u8a00\uff0cPyInstaller\u662f\u4e00\u4e2a\u5c06Python\u4ee3\u7801\u8f6c\u6362\u4e3a\u53ef\u6267\u884c\u6587\u4ef6\u7684\u5de5\u5177\u3002\u53ef\u4ee5\u5728Python\u5b98\u7f51\u4e0a\u4e0b\u8f7dPython<\/p>\n \uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528Anaconda\u7b49Python\u96c6\u6210\u73af\u5883\u3002PyInstaller\u53ef\u4ee5\u5728\u547d\u4ee4\u884c\u4e2d\u4f7f\u7528pip\u547d\u4ee4\u5b89\u88c5\u3002<\/p>\n 2.\u51c6\u5907\u6e90\u4ee3\u7801<\/p>\n \u5728\u4f7f\u7528PyInstaller\u4e4b\u524d\uff0c\u9700\u8981\u5c06Python\u6e90\u4ee3\u7801\u51c6\u5907\u597d\u3002\u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u5c06\u4f7f\u7528\u4e00\u4e2a\u7b80\u5355\u7684Python\u811a\u672c\u4f5c\u4e3a\u4f8b\u5b50\u3002\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n “`<\/p>\n print(“Hello, World!”)<\/p>\n “`<\/p>\n \u5c06\u8fd9\u4e2a\u4ee3\u7801\u4fdd\u5b58\u4e3ahello.py\u6587\u4ef6\u3002<\/p>\n 3.\u4f7f\u7528PyInstaller\u751f\u6210exe\u6587\u4ef6<\/p>\n \u5728\u547d\u4ee4\u884c\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n “`<\/p>\n pyinstaller -F hello.py<\/p>\n “`<\/p>\n \u6267\u884c\u8fd9\u4e2a\u547d\u4ee4\u540e\uff0cPyInstaller\u5c06\u81ea\u52a8\u7f16\u8bd1\u548c\u94fe\u63a5\u6e90\u4ee3\u7801\uff0c\u5e76\u751f\u6210\u4e00\u4e2a\u540d\u4e3ahello.exe\u7684\u53ef\u6267\u884c\u6587\u4ef6\u3002\u8fd9\u4e2a\u6587\u4ef6\u5305\u542b\u4e86Python\u89e3\u91ca\u5668\u548c\u6240\u9700\u7684\u5e93\u6587\u4ef6\uff0c\u53ef\u4ee5\u5728\u4efb\u4f55\u6ca1\u6709\u5b89\u88c5Python\u7684\u8ba1\u7b97\u673a\u4e0a\u8fd0\u884c\u3002<\/p>\n 4.\u8fd0\u884cexe\u6587\u4ef6<\/p>\n \u53cc\u51fbhello.exe\u6587\u4ef6\u5373\u53ef\u8fd0\u884c\u7a0b\u5e8f\uff0c\u63a7\u5236\u53f0\u5c06\u6253\u5370\u51fa\u201cHello, World!\u201d\u7684\u8f93\u51fa\u3002<\/p>\n 5.\u6253\u5305exe\u6587\u4ef6<\/p>\n \u5982\u679c\u9700\u8981\u5c06exe\u6587\u4ef6\u6253\u5305\u6210\u4e00\u4e2a\u72ec\u7acb\u7684\u6587\u4ef6\uff0c\u53ef\u4ee5\u4f7f\u7528NSIS\u7b49\u6253\u5305\u5de5\u5177\u3002\u8fd9\u91cc\u4e0d\u518d\u8d58\u8ff0\u3002<\/p>\n \u4e09\u3001\u603b\u7ed3<\/p>\n \u4e00\u952e\u751f\u6210exe\u7a0b\u5e8f\u662f\u4e00\u79cd\u975e\u5e38\u65b9\u4fbf\u7684\u5de5\u5177\uff0c\u53ef\u4ee5\u8ba9\u4e0d\u719f\u6089\u7f16\u7a0b\u8bed\u8a00\u7684\u4eba\u5458\u4e5f\u80fd\u591f\u5c06\u6e90\u4ee3\u7801\u8f6c\u6362\u4e3a\u53ef\u6267\u884c\u6587\u4ef6\u3002\u4f7f\u7528PyInstaller\u53ef\u4ee5\u5c06Pytexe\u6253\u5305\u5b89\u88c5\u7a0b\u5e8f<\/a>hon\u4ee3\u7801\u8f6c\u6362\u4e3aexe\u6587\u4ef6\uff0c\u5e76\u4e14\u53ef\u4ee5\u81ea\u5b9a\u4e49exe\u6587\u4ef6\u7684\u4e00\u4e9b\u5c5e\u6027\uff0c\u4f8b\u5982\u56fe\u6807\u3001\u7248\u672c\u53f7\u7b49\u7b49\u3002\u8fd9\u79cd\u5de5\u5177\u7684\u4f7f\u7528\u5927\u5927\u7b80\u5316\u4e86\u8f6f\u4ef6\u5f00\u53d1\u7684\u6d41\u7a0b\uff0c\u4f7f\u5f97\u66f4\u591a\u7684\u4eba\u53ef\u4ee5\u53c2\u4e0e\u5230\u8f6f\u4ef6\u5f00\u53d1\u4e2d\u6765\u3002<\/p>\n","protected":false},"excerpt":{"rendered":" \u4e00\u952e\u751f\u6210exe\u7a0b\u5e8f\u662f\u4e00\u79cd\u80fd\u591f\u5c06\u6e90\u4ee3\u7801\u81ea\u52a8\u7f16\u8bd1\u6210\u53ef\u6267\u884c\u6587\u4ef6\u7684\u5de5\u5177\u3002\u8fd9\u79cd\u5de5\u5177\u9002\u7528\u4e8e\u90a3\u4e9b\u4e0d\u719f\u6089\u7f16\u7a0b\u8bed\u8a00\u7684\u4eba\u5458\uff0c\u751a\u81f3\u8fde\u7f16\u8bd1\u5668\u90fd\u4e0d\u9700\u8981\u4e86\u89e3\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u4e00\u952e\u751f\u6210exe\u7a0b\u5e8f\u7684\u539f\u7406\u548c\u8be6\u7ec6\u6b65\u9aa4\u3002\u4e00\u3001\u539f\u7406\u4e00\u952e\u751f\u6210exe<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[23288,256,16138,16,126],"topic":[],"class_list":["post-25085","post","type-post","status-publish","format-standard","hentry","category-exekf","tag-windowsexe","tag-256","tag-exe","tag-16","tag-126"],"_links":{"self":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/25085","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/comments?post=25085"}],"version-history":[{"count":0,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/25085\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/media?parent=25085"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/categories?post=25085"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/tags?post=25085"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/topic?post=25085"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}<\/figure>\n<\/p>\n