{"id":50934,"date":"2026-07-13T12:17:34","date_gmt":"2026-07-13T04:17:34","guid":{"rendered":"https:\/\/www.anzhuoe.com\/anzhuo\/?p=50934"},"modified":"2026-07-13T12:17:34","modified_gmt":"2026-07-13T04:17:34","slug":"kitten%e7%94%9f%e6%88%90exe%e6%96%87%e4%bb%b6%e6%96%b9%e6%b3%95%e4%bb%8b%e7%bb%8d","status":"publish","type":"post","link":"https:\/\/www.anzhuoe.com\/anzhuo\/50934\/","title":{"rendered":"kitten\u751f\u6210exe\u6587\u4ef6\u65b9\u6cd5\u4ecb\u7ecd"},"content":{"rendered":"<p>Kitten\u662f\u4e00\u4e2aPython\u7a0b\u5e8f\u5e93\uff0c\u652f\u6301\u5f00\u53d1\u8de8\u5e73\u53f0\u7684\u56fe\u5f62\u754c\u9762\u5e94\u7528\u7a0b\u5e8f\u3002\u751f\u6210exe\u6587\u4ef6\u662f\u6307\u5c06\u4e00\u4e2aPython\u7a0b\u5e8f\u6587\u4ef6\uff08.py\u6587\u4ef6\uff09\u6253\u5305\u6210\u4e00\u4e2a\u72ec\u7acb\u7684Windows\u53ef\u6267\u884c\u6587\u4ef6\uff08.exe\u6587\u4ef6\uff09\uff0c\u8ba9\u7528\u6237\u65e0\u9700\u5b89\u88c5Python\u73af\u5883\u5c31\u53ef\u4ee5\u8fd0\u884c\u8be5\u7a0b\u5e8f\u3002\u5728\u8fd9\u7bc7\u6587\u7ae0\u4e2d\uff0c\u6211\u4eec\u5c06\u4e86\u89e3\u5982\u4f55\u4f7f\u7528Kitten\u751f\u6210exe\u6587\u4ef6\u7684\u539f\u7406\u4ee5\u53ca\u8be6\u7ec6\u6b65\u9aa4\u3002<\/p>\n<p>\u539f\u7406\uff1a<\/p>\n<p>\u5c06Python\u7a0b\u5e8f\u8f6c\u6362\u6210exe\u6587\u4ef6\u7684\u65b9\u5f0f\uff0c\u901a\u5e38\u5305\u62ec\u4ee5\u4e0b\u51e0\u4e2a\u6b65\u9aa4\uff1a<\/p>\n<p>1. \u5c06Python\u6e90\u4ee3\u7801\u7f16\u8bd1\u4e3a\u5b57\u8282\u7801\uff08.pyc\u6587\u4ef6\uff09\u3002<\/p>\n<p>2. \u5c06\u5b57\u8282\u7801\u4e0e\u4e00\u4e2aPython\u89e3\u91ca\u5668\uff08\u5982CPython\uff09\u6253\u5305\u5230\u4e00\u4e2a\u5355\u4e00\u7684exe\u6587\u4ef6\u3002\u8fd9\u4e2a\u89e3\u91ca\u5668\u88ab\u79f0\u4e3a\u201c\u5d4c\u5165\u5f0fPython\u201d\uff0c\u5b83\u4f1a\u5728\u6267\u884cexe\u6587\u4ef6\u65f6\u8fd0\u884c\u5b57\u8282\u7801\u3002<\/p>\n<p>3. \u5c06\u6240\u9700\u7684\u4f9d\u8d56\u5e93\uff08\u5982Kitten\u548c\u5176\u4ed6Python\u5305\uff09\u6253\u5305\u5230exe\u6587\u4ef6\u4e2d\u3002<\/p>\n<p>4. \u4ee5\u9700\u8981\u7684\u8d44\u6e90\u6587\u4ef6\uff08\u5982\u56fe\u50cf\u548c\u97f3\u9891\u6587\u4ef6\uff09\u6253\u5305\u5230exe\u6587\u4ef6\u3002<\/p>\n<p>5. \u5728\u7a0b\u5e8f\u6267\u884c\u65f6\uff0c\u5c06\u8fd9\u4e9b\u88ab\u6253\u5305\u7684\u8d44\u6e90\u89e3\u538b\u5230\u4e34\u65f6\u76ee\u5f55\uff0c\u7136\u540e\u52a0\u8f7d\u5e76\u8fd0\u884c\u3002<\/p>\n<p>\u8be6\u7ec6\u6b65\u9aa4\uff1a<\/p>\n<p>\u4e3a\u4e86\u5c06Kitten\u7a0b\u5e8f\u6253\u5305\u6210exe\u6587\u4ef6\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528pyinstaller\u5de5\u5177\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528pyinstaller\u751f\u6210exe\u6587\u4ef6\u7684\u6b65\u9aa4\uff1a<\/p>\n<p>\u6b65\u9aa41\uff1a\u5b89\u88c5pyinstaller<\/p>\n<p>\u5728\u547d\u4ee4\u884c\u4e2d\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff0c\u786e\u4fdd\u5df2\u5b89\u88c5pyinstaller\uff1a<\/p>\n<p>`<a href=\"https:\/\/www.yimenexe.com\/ruanjian-kaifa-1232.html\">matlab\u6253\u5305\u4e2d\u6587exe\u6587\u4ef6<\/a>&#8220;<\/p>\n<p>pip install pyinstaller<\/p>\n<p>&#8220;`<\/p>\n<p>\u6b65\u9aa42\uff1a\u7f16\u5199 Kitten \u7a0b\u5e8f<\/p>\n<p>\u5728\u4f60\u9009\u62e9\u7684\u76ee\u5f55\u4e2d\uff0c\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a\u201cmy_kitten_app.py\u201d\u7684Python\u6587\u4ef6\uff0c\u5e76\u7f16\u5199\u4e00\u4e2a\u7b80\u5355\u7684Kitten\u5e94\u7528\u7a0b\u5e8f\u3002\u4f8b\u5982\uff1a<\/p>\n<p>&#8220;`python<\/p>\n<p>from kivy.app import App<\/p>\n<p>from kivy.uix.button import Button<\/p>\n<p>class MyApp(App):<\/p>\n<p>    def build(self):<\/p>\n<p>        return Button(text=&#8217;Hello Kitten!&#8217;)<\/p>\n<p>if __name__ == &#8216;__main__&#8217;:<\/p>\n<p>    MyApp().run()<\/p>\n<p>&#8220;`<\/p>\n<p>\u6b65\u9aa43\uff1a\u4f7f\u7528pyinstaller\u751f\u6210exe\u6587\u4ef6<\/p>\n<p>\u5728\u547d\u4ee4\u884c\u4e2d\uff0c\u8f6c\u5230\u5b58\u653e\u201cmy_kitten_app.py\u201d\u6587\u4ef6\u7684\u76ee\u5f55\uff0c\u7136\u540e\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>pyinstaller &#8211;onefile <\/p>\n<p><figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/cdn.myapp.ltd\/ag\/131\/sucai\/21.jpg\" \/><\/figure>\n<\/p>\n<p>&#8211;windowed my_kitten_app.py<\/p>\n<p>&#8220;`<\/p>\n<p>\u8fd9\u5c06\u751f\u6210\u4e00\u4e2a\u5355\u4e00\u6587\u4ef6\u7684exe\u6587\u4ef6\uff0c\u5e76\u4e14\u5f53\u7a0b\u5e8f\u8fd0\u884c\u65f6\u4e0d\u4f1a\u663e\u793a\u547d\u4ee4\u884c\u7a97\u53e3\u3002<\/p>\n<p>\u53c2\u6570\u89e3\u91ca\uff1a<\/p>\n<p>&#8211; `&#8211;onefile`\uff1a\u6307\u793apyinstaller\u751f\u6210\u4e00\u4e2a\u5355\u4e00\u7684exe\u6587\u4ef6\uff0c\u800c\u4e0d\u662f\u4e00\u4e2a\u5e26\u6709\u4f9d\u8d56\u5e93\u7684\u5355\u72ec\u6587\u4ef6\u5939\u3002<\/p>\n<p>&#8211; `&#8211;windowed`\uff1a\u9690\u85cf\u547d\u4ee4\u884c\u7a97\u53e3\uff0c\u4f7f\u5f97\u7a0b\u5e8f\u770b\u8d77\u6765\u5c31\u50cf\u4e00\u4e2aGUI\u5e94\u7528\u7a0b\u5e8f\u3002<a href=\"https:\/\/www.yimenexe.com\/ruanjian-kaifa-7028.html\">\u600e\u6837\u5c06\u7f51\u9875\u505a\u6210exe<\/a><\/p>\n<p>\u6b65\u9aa44\uff1a\u83b7\u53d6\u751f\u6210\u7684exe\u6587\u4ef6<\/p>\n<p>\u5b8c\u6210\u4e0a\u8ff0\u6b65\u9aa4\u540e\uff0c\u4f60\u4f1a\u5728\u4e0e\u201cmy_kitten_app.py\u201d\u6587\u4ef6\u76f8\u540c\u7684\u76ee\u5f55\u4e0b\u627e\u5230\u4e00\u4e2a\u540d\u4e3a\u201cdist\u201d\u7684\u6587\u4ef6\u5939\u3002\u5176\u4e2d\u5305\u542b\u4e00\u4e2a\u540d\u4e3a\u201cmy_kitten_app.exe\u201d\u7684exe\u6587\u4ef6\u3002\u5c06\u6b64\u6587\u4ef6\u53d1\u9001\u7ed9\u4efb\u4f55\u9700\u8981\u8fd0\u884c\u4f60\u7684\u7a0b\u5e8f\u7684\u4eba\uff0c\u4ed6\u4eec\u65e0\u9700\u5b89\u88c5Python\u73af\u5883\u5373\u53ef\u8fd0\u884c\u3002<\/p>\n<p>\u73b0\u5728\uff0c\u4f60\u5df2\u4e86\u89e3\u4e86\u5982\u4f55\u5c06Kitten\u7a0b\u5e8f\u6253\u5305\u4e3aexe\u6587\u4ef6\u7684\u539f\u7406\u548c\u8be6\u7ec6\u6b65\u9aa4\u3002\u5e0c\u671b\u8fd9\u7bc7\u6587\u7ae0\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9\uff0c\u795d\u4f60\u7f16\u7a0b\u6109\u5feb\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Kitten\u662f\u4e00\u4e2aPython\u7a0b\u5e8f\u5e93\uff0c\u652f\u6301\u5f00\u53d1\u8de8\u5e73\u53f0\u7684\u56fe\u5f62\u754c\u9762\u5e94\u7528\u7a0b\u5e8f\u3002\u751f\u6210exe\u6587\u4ef6\u662f\u6307\u5c06\u4e00\u4e2aPython\u7a0b\u5e8f\u6587\u4ef6\uff08.py\u6587\u4ef6\uff09\u6253\u5305\u6210\u4e00\u4e2a\u72ec\u7acb\u7684Windows\u53ef\u6267\u884c\u6587\u4ef6\uff08.exe\u6587\u4ef6\uff09\uff0c\u8ba9\u7528\u6237\u65e0\u9700<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[38769,558,27,774,49],"topic":[],"class_list":["post-50934","post","type-post","status-publish","format-standard","hentry","category-ruanjiankaifa","tag-pythonexe","tag-558","tag-27","tag-774","tag-49"],"_links":{"self":[{"href":"https:\/\/www.anzhuoe.com\/anzhuo\/wp-json\/wp\/v2\/posts\/50934","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.anzhuoe.com\/anzhuo\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.anzhuoe.com\/anzhuo\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.anzhuoe.com\/anzhuo\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/www.anzhuoe.com\/anzhuo\/wp-json\/wp\/v2\/comments?post=50934"}],"version-history":[{"count":1,"href":"https:\/\/www.anzhuoe.com\/anzhuo\/wp-json\/wp\/v2\/posts\/50934\/revisions"}],"predecessor-version":[{"id":50947,"href":"https:\/\/www.anzhuoe.com\/anzhuo\/wp-json\/wp\/v2\/posts\/50934\/revisions\/50947"}],"wp:attachment":[{"href":"https:\/\/www.anzhuoe.com\/anzhuo\/wp-json\/wp\/v2\/media?parent=50934"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.anzhuoe.com\/anzhuo\/wp-json\/wp\/v2\/categories?post=50934"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.anzhuoe.com\/anzhuo\/wp-json\/wp\/v2\/tags?post=50934"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.anzhuoe.com\/anzhuo\/wp-json\/wp\/v2\/topic?post=50934"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}