{"id":21998,"date":"2023-07-03T12:19:15","date_gmt":"2023-07-03T04:19:15","guid":{"rendered":"https:\/\/www.yimenapp.com\/kb-yimen\/?p=21998"},"modified":"2023-07-03T12:19:15","modified_gmt":"2023-07-03T04:19:15","slug":"ghost11%e5%a6%82%e4%bd%95%e7%94%9f%e6%88%90exe%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/www.yimenapp.com\/kb-yimen\/21998\/","title":{"rendered":"ghost11\u5982\u4f55\u751f\u6210exe\uff1f"},"content":{"rendered":"<p>Ghost11\u662f\u4e00\u6b3e\u5907\u4efd\u4e0e\u8fd8\u539f\u8f6f\u4ef6\uff0c\u5b83\u53ef\u5236\u4f5c\u786c\u76d8\u955c\u50cf\u4ee5\u4fbf\u5728\u7cfb\u7edf\u51fa\u73b0\u95ee\u9898\u65f6\u5feb\u901f\u6062\u590d\u3002\u5b83\u4e0d\u80fd\u751f\u6210<span class=\"wpcom_keyword_link\"><a href=\"https:\/\/exe.yimenapp.com\" title=\"exe\u5f00\u53d1\u4ece\u4e00\u95e8\u5f00\u59cb\">exe<\/a><\/span><span class=\"wpcom_tag_link\"><a href=\"https:\/\/www.yimenapp.com\/kb-yimen\/tag\/%e6%96%87%e4%bb%b6\/\" title=\"\u6587\u4ef6\" target=\"_blank\">\u6587\u4ef6<\/a><\/span>\u3002\u53ef\u80fd\u60a8\u8981\u5bfb\u627e\u7684\u662f\u5c06Python<span class=\"wpcom_tag_link\"><a href=\"https:\/\/www.yimenapp.com\/kb-yimen\/tag\/jiaoben\/\" title=\"\u811a\u672c\" target=\"_blank\">\u811a\u672c<\/a><\/span>\u8f6c\u6362\u6210exe\u53ef\u6267\u884c\u6587\u4ef6\u7684\u65b9\u6cd5\u3002\u5982\u679c\u662f\u8fd9\u4e2a\u9700\u6c42\uff0c\u4e0b\u9762\u662f\u5173\u4e8e\u4f7f\u7528pyinstaller\u5c06Python\u811a\u672c\u8f6c\u6362\u6210exe\u6587\u4ef6\u7684\u8be6\u7ec6\u6559\u7a0b\uff1a<\/p>\n<p>\u4e00\u3001\u73af\u5883\u51c6\u5907\uff1a<\/p>\n<p>1. \u5b89\u88c5Python\uff1a\u8bf7\u786e\u4fdd\u60a8\u7684\u7535\u8111\u5df2\u7ecf\u5b89\u88c5\u4e86Python\u3002\u60a8\u53ef\u4ee5\u524d\u5f80Python\u5b98\u7f51\uff08https:\/\/www.python.org\/\uff09\u4e0b\u8f7d\u9002\u5408\u60a8\u64cd\u4f5c\u7cfb\u7edf\u7684\u6700\u65b0\u7248Python\u5e76\u5b89\u88c5\u3002<\/p>\n<p>2. \u5b89\u88c5pyinstaller\uff1a\u5728\u5b89\u88c5\u597dPython\u540e\uff0c\u8bf7\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\uff08Windows\uff09\u6216<span class=\"wpcom_tag_link\"><a href=\"https:\/\/www.yimenapp.com\/kb-yimen\/tag\/%e7%bb%88%e7%ab%af\/\" title=\"\u7ec8\u7aef\" target=\"_blank\">\u7ec8\u7aef<\/a><\/span>\uff08MacOS\/Linux\uff09\u5e76\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u4ee5\u5b89\u88c5pyinstaller\uff1a<\/p>\n<p><figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/i.cdn.yimenapp.com\/2023-03\/22\/11\/33610877714.jpg\" \/><\/figure><\/p>\n<p>&#8220;`<\/p>\n<p>pip install pyinstaller<\/p>\n<p>&#8220;`<\/p>\n<p>\u8fd9\u4e00\u547d\u4ee4\u5c06\u5b89\u88c5\u6700\u65b0\u7248\u7684pyinstaller\u3002<\/p>\n<p>\u4e8c\u3001\u5b8c\u6210Python\u811a\u672c\u7f16\u5199\uff1a<\/p>\n<p>\u7f16\u5199\u597d\u9700\u8981\u8f6c\u6362\u4e3aexe\u7684Python\u811a\u672c\u3002\u8bf7\u786e\u4fdd\u811a\u672c\u80fd\u591f\u5728\u7cfb\u7edf\u4e0a\u6b63\u5e38\u8fd0\u884c\u3002\u4f8b\u5982\uff0c\u6211\u4eec\u5c06\u811a\u672c\u547d\u540d\u4e3a\u201cexample.py\u201d\u3002<\/p>\n<p>\u76ee\u5f55\u7ed3\u6784\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>my_project\/<\/p>\n<p>\u251c\u2500\u2500 example.py<\/p>\n<p>&#8220;`<\/p>\n<p>\u4e09\u3001\u8fd0\u884cpyinstaller\u4ee5\u751f\u6210exe\uff1a<\/p>\n<p>1. \u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\uff08Windows\uff09\u6216\u7ec8\u7aef\uff08MacOS\/Linux\uff09\uff0c\u5e76\u8fdb\u5165\u5230\u60a8\u7684Python\u811a\u672c\u6240\u5728\u76ee\u5f55\u3002\u4f8b<a href=\"https:\/\/www.yimenexe.com\/exe-kaifa-491.html\">debian\u6253\u5305<\/a>\u5982\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>cd my_project<\/p>\n<p>&#8220;`<\/p>\n<p>2. \u5728\u547d\u4ee4\u63d0\u793a\u7b26\u6216\u7ec8\u7aef\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\uff0c\u5c06Python\u811a\u672c\u8f6c\u6362\u4e3a\u5355\u4e2aexe\u6587\u4ef6\u3002\u8bf7\u5c06\u201cexample.py\u201d\u66ff\u6362\u4e3a\u60a8\u81ea\u5df1\u7684\u811a\u672c\u540d\u79f0\u3002<\/p>\n<p>&#8220;`<\/p>\n<p>pyinstaller &#8211;onefile example.py<\/p>\n<p>&#8220;`<\/p>\n<p>\u6b64\u65f6\uff0cpyinstaller\u5c06\u5f00\u59cb\u5206\u6790\u811a\u672c\uff0c\u5bfb\u627e\u4f9d\u8d56\u5173\u7cfb\u4ee5\u751f\u6210exe\u6587\u4ef6\u3002<\/p>\n<p>\u56db\u3001\u63d0\u53d6\u751f\u6210\u7684exe\u6587\u4ef6\uff1a<\/p>\n<p>1. \u751f\u6210\u7684exe\u6587\u4ef6\u5c06\u4f4d\u4e8e\u4ee5\u4e0b\u4f4d\u7f6e\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>my_project\/<\/p>\n<p>\u251c\u2500\u2500 example.py<\/p>\n<p>\u2514\u2500\u2500 dist\/<\/p>\n<p>    \u2514\u2500\u2500 example.exe (\u5728Windows\u7cfb\u7edf\u4e2d)<\/p>\n<p>&#8220;`<\/p>\n<p>2. \u60a8\u53ef\u4ee5\u5c06\u201cdist\u201d\u76ee\u5f55\u4e0b\u7684\u201cexample.exe\u201d\u53d1\u9001\u7ed9\u5176\u4ed6\u4eba\uff08\u4ec5\u9650Windows\u7528\u6237\uff09\u4f7f\u7528\u3002\u4ed6\u4eec\u65e0\u9700\u5b89\u88c5Python\u5373<a href=\"https:\/\/www.yimenexe.com\/ruanjian-kaifa-6844.html\">\u600e\u4e48\u628a\u6587\u4ef6\u505a\u6210exe<\/a>\u53ef\u8fd0\u884c\u6b64exe\u6587\u4ef6\u3002<\/p>\n<p>\u5e0c\u671b\u4e0a\u8ff0\u6559\u7a0b\u5bf9\u60a8\u6709\u5e2e\u52a9\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ghost11\u662f\u4e00\u6b3e\u5907\u4efd\u4e0e\u8fd8\u539f\u8f6f\u4ef6\uff0c\u5b83\u53ef\u5236\u4f5c\u786c\u76d8\u955c\u50cf\u4ee5\u4fbf\u5728\u7cfb\u7edf\u51fa\u73b0\u95ee\u9898\u65f6\u5feb\u901f\u6062\u590d\u3002\u5b83\u4e0d\u80fd\u751f\u6210exe\u6587\u4ef6\u3002\u53ef\u80fd\u60a8\u8981\u5bfb\u627e\u7684\u662f\u5c06Python\u811a\u672c\u8f6c\u6362\u6210exe\u53ef\u6267\u884c\u6587\u4ef6\u7684\u65b9\u6cd5\u3002\u5982\u679c\u662f\u8fd9\u4e2a\u9700\u6c42\uff0c\u4e0b\u9762\u662f\u5173\u4e8e\u4f7f\u7528<\/p>\n","protected":false},"author":20,"featured_media":0,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[17212,17213,2708,2057,390],"special":[],"attr":[],"class_list":["post-21998","post","type-post","status-publish","format-standard","hentry","category-zixun","tag-pythonexe","tag-mexe","tag-2708","tag-2057","tag-jiaoben","entry"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts\/21998","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/users\/20"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/comments?post=21998"}],"version-history":[{"count":0,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts\/21998\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/media?parent=21998"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/categories?post=21998"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/tags?post=21998"},{"taxonomy":"special","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/special?post=21998"},{"taxonomy":"attr","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/attr?post=21998"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}