{"id":12777,"date":"2023-12-20T15:44:02","date_gmt":"2023-12-20T07:44:02","guid":{"rendered":"https:\/\/www.yimenyun.cn\/emen\/?p=12777"},"modified":"2023-12-20T15:44:02","modified_gmt":"2023-12-20T07:44:02","slug":"tkinterdesigner%e6%89%93%e5%8c%85exe%e6%96%b9%e6%b3%95%e6%ad%a5%e9%aa%a4%e4%bb%8b%e7%bb%8d","status":"publish","type":"post","link":"https:\/\/www.yimenyun.cn\/emen\/12777\/","title":{"rendered":"tkinterdesigner\u6253\u5305exe\u65b9\u6cd5\u6b65\u9aa4\u4ecb\u7ecd"},"content":{"rendered":"

Tkinter Designer\u662f\u4e00\u4e2a\u53ef\u89c6\u5316\u7684Tkinter GUI\u8bbe\u8ba1\u5668\uff0c\u53ef\u4ee5\u901a\u8fc7\u7b80\u5355\u7684\u62d6\u653e\u64cd\u4f5c\u6765\u521b\u5efaGUI\u5e94\u7528\u7a0b\u5e8f\u3002\u5b83\u53ef\u4ee5\u5e2e\u52a9\u5f00\u53d1\u8005\u5feb\u901f\u521b\u5efaGUI\u754c\u9762\uff0c\u800c\u4e0d\u5fc5\u624b\u52a8\u7f16\u5199\u4ee3\u7801\u3002\u5728Tkinter Designer\u4e2d\u521b\u5efa\u7684GUI\u754c\u9762\u53ef\u4ee5\u76f4\u63a5\u8f6f\u4ef6\u6253\u5305<\/a>\u5bfc\u51fa\u4e3aPython\u4ee3\u7801\uff0c\u5e76\u4e14\u53ef\u4ee5\u4f7f\u7528PyInstaller\u5c06\u5176\u6253\u5305\u6210\u53ef\u6267\u884c\u6587\u4ef6\u3002<\/p>\n

PyInstaller\u662f\u4e00\u4e2a\u7528\u4e8e\u5c06Python\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210\u72ec\u7acb\u7684\u53ef\u6267\u884c\u6587\u4ef6\u7684\u5de5\u5177\u3002\u5b83\u53ef\u4ee5\u5c06Python\u89e3\u91ca\u5668\u3001\u4f9d\u8d56\u5e93\u548c\u5e94\u7528\u7a0b\u5e8f\u4ee3\u7801\u6253\u5305\u6210\u4e00\u4e2a\u5355\u72ec\u7684\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u4f7f\u5f97\u5e94\u7528\u7a0b\u5e8f\u53ef\u4ee5\u5728\u6ca1\u6709Python\u73af\u5883\u7684\u8ba1\u7b97\u673a\u4e0a\u8fd0\u884c\u3002PyInstaller\u652f\u6301Windows\u3001Linux\u548cMac OS X\u7b49\u64cd\u4f5c\u7cfb\u7edf\u3002<\/p>\n

\u6253\u5305Tkinter Designer\u751f\u6210\u7684Python\u4ee3\u7801\u4e3a\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u9700\u8981\u4f7f\u7528PyInstaller\u8fdb\u884c\u4ee5\u4e0b\u6b65\u9aa4\uff1a<\/p>\n

1. \u5b89\u88c5PyInstaller<\/p>\n

\u53ef\u4ee5\u901a\u8fc7pip\u5b89\u88c5PyInstaller\uff1a<\/p>\n

“`<\/p>\n

pip install pyinstaller<\/p>\n

“`<\/p>\n

2exe\u64ad\u653e\u5668<\/a>. \u6253\u5305Python\u4ee3\u7801<\/p>\n

\u5728Tkinter Designer\u4e2d\u521b\u5efaGUI\u754c\u9762\u540e\uff0c\u53ef\u4ee5\u5bfc\u51fa\u4e3aPython\u4ee3\u7801\u3002\u5c06\u5bfc\u51fa\u7684Python\u4ee3\u7801\u4fdd\u5b58\u4e3a\u4e00\u4e2a\u6587\u4ef6\uff0c\u4f8b\u5982myapp.py\u3002<\/p>\n

\u5728\u547d\u4ee4\u884c\u4e2d\u8fdb\u5165myapp.py\u6240\u5728\u7684\u76ee\u5f55\uff0c\u7136\u540e\u6267\u884c<\/p>\n

<\/figure>\n<\/p>\n

\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

“`<\/p>\n

pyinstaller myapp.py<\/p>\n

“`<\/p>\n

\u8fd9\u4e2a\u547d\u4ee4\u4f1a\u5c06myapp.py\u53ca\u5176\u4f9d\u8d56\u5e93\u6253\u5305\u6210\u4e00\u4e2a\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u751f\u6210\u5728dist\u76ee\u5f55\u4e0b\u3002<\/p>\n

\u5728Windows\u4e0a\uff0c\u751f\u6210\u7684\u53ef\u6267\u884c\u6587\u4ef6\u4e3amyapp.exe\uff1b\u5728Linux\u548cMac OS X\u4e0a\uff0c\u751f\u6210\u7684\u53ef\u6267\u884c\u6587\u4ef6\u4e3amyapp\u3002<\/p>\n

3. \u8fd0\u884c\u53ef\u6267\u884c\u6587\u4ef6<\/p>\n

\u5c06\u751f\u6210\u7684\u53ef\u6267\u884c\u6587\u4ef6\u590d\u5236\u5230\u5176\u4ed6\u8ba1\u7b97\u673a\u4e0a\uff0c\u5373\u53ef\u8fd0\u884c\u5e94\u7528\u7a0b\u5e8f\u3002\u5728Windows\u4e0a\uff0c\u53cc\u51fbmyapp.exe\u5373\u53ef\u8fd0\u884c\u5e94\u7528\u7a0b\u5e8f\uff1b\u5728Linux\u548cMac OS X\u4e0a\uff0c\u9700\u8981\u5728\u547d\u4ee4\u884c\u4e2d\u8fd0\u884cmyapp\u3002<\/p>\n

\u603b\u7ed3\uff1a<\/p>\n

\u901a\u8fc7\u4f7f\u7528Tkinter Designer\u548cPyInstaller\uff0c\u53ef\u4ee5\u5feb\u901f\u521b\u5efaGUI\u5e94\u7528\u7a0b\u5e8f\uff0c\u5e76\u5c06\u5176\u6253\u5305\u6210\u72ec\u7acb\u7684\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u65b9\u4fbf\u5728\u5176\u4ed6\u8ba1\u7b97\u673a\u4e0a\u8fd0\u884c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

Tkinter Designer\u662f\u4e00\u4e2a\u53ef\u89c6\u5316\u7684Tkinter GUI\u8bbe\u8ba1\u5668\uff0c\u53ef\u4ee5\u901a\u8fc7\u7b80\u5355\u7684\u62d6\u653e\u64cd\u4f5c\u6765\u521b\u5efaGUI\u5e94\u7528\u7a0b\u5e8f\u3002\u5b83\u53ef\u4ee5\u5e2e\u52a9\u5f00\u53d1\u8005\u5feb\u901f\u521b\u5efaGUI\u754c\u9762\uff0c\u800c\u4e0d\u5fc5\u624b\u52a8\u7f16\u5199\u4ee3\u7801\u3002\u5728Tkinter De<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[17645,17644,29,256,12],"topic":[],"class_list":["post-12777","post","type-post","status-publish","format-standard","hentry","category-exekf","tag-webexe","tag-windows","tag-29","tag-256","tag-12"],"_links":{"self":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/12777","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\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/comments?post=12777"}],"version-history":[{"count":1,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/12777\/revisions"}],"predecessor-version":[{"id":12924,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/12777\/revisions\/12924"}],"wp:attachment":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/media?parent=12777"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/categories?post=12777"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/tags?post=12777"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/topic?post=12777"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}