{"id":27099,"date":"2024-04-16T17:49:23","date_gmt":"2024-04-16T09:49:23","guid":{"rendered":"https:\/\/h5app.yimenapp.cn\/h5app\/?p=27099"},"modified":"2024-04-16T17:49:23","modified_gmt":"2024-04-16T09:49:23","slug":"uiapp%e9%a1%b9%e7%9b%ae%e6%89%93%e5%8c%85%e6%88%90app%e6%96%b9%e6%b3%95%e4%bb%8b%e7%bb%8d","status":"publish","type":"post","link":"https:\/\/h5app.yimenapp.cn\/h5app\/2024\/sjapp\/27099\/","title":{"rendered":"uiapp\u9879\u76ee\u6253\u5305\u6210app\u65b9\u6cd5\u4ecb\u7ecd"},"content":{"rendered":"<p>UIApp\u662f\u4e00\u79cd\u57fa\u4e8ePython\u8bed\u8a00\u7684GUI\u5e94\u7528\u7a0b\u5e8f\u5f00\u53d1\u6846\u67b6\uff0c\u901a\u8fc7\u4f7f\u7528\u8be5\u6846\u67b6\uff0c\u53ef\u4ee5\u5feb\u901f\u5f00\u53d1\u51fa\u5177\u6709\u826f\u597d\u7528\u6237\u754c\u9762\u548c\u529f\u80fd\u7684\u5e94\u7528\u7a0b\u5e8f\u3002\u7136\u800c\uff0c\u5f00\u53d1\u51fa\u6765\u7684\u5e94\u7528\u7a0b\u5e8f\u4ec5\u9650\u4e8e\u5728Python\u73af\u5883\u4e0b\u8fd0\u884c\uff0c\u5982\u679c\u60f3\u8981\u5c06\u5176\u6253\u5305\u6210\u4e3a\u72ec\u7acb\u7684\u5e94\u7528\u7a0b\u5e8f\uff0c\u5219\u9700\u8981\u8fdb\u884c\u6253\u5305\u64cd\u4f5c\u3002\u672c\u6587\u5c06\u4ecb\u7ecdUIApp\u9879\u76ee\u6253\u5305\u6210APP\u7684\u539f\u7406\u548c\u8be6\u7ec6\u6b65\u9aa4\u3002<\/p>\n<p>\u4e00\u3001\u6253\u5305\u539f\u7406<\/p>\n<p>\u5728Python\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528pyinstaller\u8fd9\u4e2a\u7b2c\u4e09\u65b9\u5e93\u6765\u5b9e\u73b0\u5c06Python\u7a0b\u5e8f\u6253\u5305\u6210\u4e3a\u53ef\u6267\u884c\u7684\u5e94\u7528\u7a0b\u5e8f\u3002pyinstaller\u4f1a\u5c06Python\u7a0b\u5e8f\u53ca\u5176\u4f9d\u8d56\u7684\u5e93\u6587\u4ef6\u6253\u5305\u6210\u4e3a\u4e00\u4e2a\u72ec\u7acb\u7684\u6587\u4ef6\u5939\uff0c\u5176\u4e2d\u5305\u62ec\u4e86\u53ef\u6267\u884c\u6587\u4ef6\u3001\u4f9d\u8d56\u7684\u5e93\u6587\u4ef6\u4ee5\u53ca\u8d44\u6e90\u6587\u4ef6\u7b49\u3002\u5728\u6253\u5305\u8fc7\u7a0b\u4e2d\uff0cpyinstaller\u4f1a\u6839\u636ePython\u7a0b\u5e8f\u7684\u4ee3\u7801\u548c\u4f9d\u8d56\u5e93\u7684\u5f15\u7528\u5173\u7cfb\uff0c\u81ea\u52a8\u5c06\u9700\u8981\u7684\u5e93\u6587\u4ef6\u6253\u5305\u8fdb\u53bb\uff0c\u4ece\u800c\u4fdd\u8bc1\u4e86\u6253\u5305\u540e\u7684\u5e94\u7528\u7a0b\u5e8f\u53ef\u4ee5\u5728\u6ca1\u6709Python\u73af\u5883\u7684\u60c5\u51b5\u4e0b\u8fd0\u884c\u3002<\/p>\n<p>\u4e8c\u3001\u6253\u5305\u6b65\u9aa4<\/p>\n<p>\u4ee5\u4e0b\u662fUIApp\u9879\u76ee\u6253\u5305\u6210APP\u7684\u8be6\u7ec6\u6b65\u9aa4\uff1a<\/p>\n<p>1. \u5b89\u88c5pyinstaller<\/p>\n<p>pyinstaller\u53ef\u4ee5\u901a\u8fc7pip\u8fdb\u884c\u5b89\u88c5\uff0c\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u5373\u53ef\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>pip install pyinstaller<\/p>\n<p>&#8220;`<\/p>\n<p>2. \u521b\u5efaspec\u6587\u4ef6<\/p>\n<p>\u5728UIApp\u9879\u76ee\u7684\u6839\u76ee\u5f55\u4e0b\uff0c\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u521b\u5efaspec\u6587\u4ef6\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>pyinstaller -y -F <a href=\"https:\/\/appdabao.yimenapp.com\/jiage-656.html\">\u5c06\u7f51\u9875\u6253\u5305\u6210ios<\/a>main.py<\/p>\n<p>&#8220;`<\/p>\n<p>\u5176\u4e2d\uff0c-y\u53c2\u6570\u8868\u793a\u5728\u6253\u5305\u65f6\u4e0d\u9700\u8981\u8be2\u95ee\u4efb\u4f55\u95ee\u9898\uff0c-F\u53c2\u6570\u8868\u793a\u5c06\u6240\u6709\u7684\u4f9d\u8d56\u5e93\u6253\u5305\u6210\u4e3a\u5355\u4e2a\u53ef\u6267\u884c\u6587\u4ef6\uff0cmain.py\u8868\u793aUIApp\u9879\u76ee\u7684\u5165\u53e3\u6587\u4ef6\u3002<\/p>\n<p>\u6267\u884c\u5b8c\u4ee5\u4e0a\u547d\u4ee4\u540e\uff0c\u4f1a\u5728UIApp\u9879\u76ee\u7684\u6839\u76ee\u5f55\u4e0b\u751f\u6210\u4e00\u4e2a.spec\u6587\u4ef6\uff0c\u8be5\u6587\u4ef6\u662fpyinstaller\u6253\u5305\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u6211\u4eec\u9700\u8981\u6839\u636e\u9879\u76ee\u7684\u5b9e\u9645\u60c5\u51b5\u8fdb\u884c\u4fee\u6539\u3002<\/p>\n<p>3. \u4fee\u6539spec\u6587\u4ef6<\/p>\n<p>\u6253\u5f00.spec\u6587\u4ef6\uff0c\u53ef\u4ee5\u770b\u5230\u5176\u4e2d\u5305\u542b\u4e86\u4e00\u4e9b\u914d\u7f6e\u4fe1\u606f\uff0c\u6bd4\u5982\u5e94\u7528\u7a0b\u5e8f\u7684\u540d\u79f0\u3001\u7248\u672c\u53f7\u3001\u56fe\u6807\u3001\u4f9d\u8d56\u5e93\u7b49\u7b49\u3002\u6211\u4eec\u9700\u8981\u6839\u636e\u9879\u76ee\u7684\u5b9e\u9645\u60c5\u51b5\u8fdb\u884c\u4fee\u6539\u3002<\/p>\n<p>\u4ee5UIApp\u9879\u76ee\u4e3a\u4f8b\uff0c\u4ee5\u4e0b\u662f\u4e00\u4e2a.spec\u6587\u4ef6\u7684\u793a\u4f8b\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p># -*- mode: python ; coding: utf-8 -*-<\/p>\n<p>block_cipher = None<\/p>\n<p>a = Analysis([&#8216;main.py&#8217;],<\/p>\n<p>             pathex=[&#8216;\/Users\/user\/Desktop\/UIApp&#8217;],<\/p>\n<p>             binaries=[],<\/p>\n<p>             datas=[],<\/p>\n<p>             hiddenimports=[<\/p>\n<p><figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/i.yimenyun.net\/2023-03\/20\/18\/02252263799.jpg\" \/><\/figure>\n<\/p>\n<p>&#8216;PyQt5.QtWidgets&#8217;, &#8216;PyQt5.QtCore&#8217;, &#8216;PyQt5.QtGui&#8217;, &#8216;PyQt5.QtWebEngineWidgets&#8217;, &#8216;PyQt5.QtWebEngineCore&#8217;, &#8216;PyQt5.QtNetwork&#8217;, &#8216;PyQt5.QtPrintSupport&#8217;, &#8216;PyQt5.QtMultimedia&#8217;, &#8216;PyQt5.QtMultimediaWidgets&#8217;, &#8216;PyQt5.QtSql&#8217;, &#8216;PyQt5.QtSvg&#8217;, &#8216;PyQt5.QtXml&#8217;, &#8216;PyQt5.QtOpenGL&#8217;, &#8216;PyQt5.QtBluetooth&#8217;, &#8216;PyQt5.QtWebSockets&#8217;, &#8216;PyQt5.QtWebChannel&#8217;, &#8216;PyQt5.QtQuick&#8217;, &#8216;PyQt5.QtQml&#8217;, &#8216;PyQt5.QtTest&#8217;, &#8216;uiapp.resources&#8217;],<\/p>\n<p>             hookspath=[],<\/p>\n<p>             runtime_hooks=[],<\/p>\n<p>             excludes=[],<\/p>\n<p>             win_no_prefer_redirects=False,<\/p>\n<p>             win_private_assemblies=False,<\/p>\n<p>             cipher=block_cipher,<\/p>\n<p>             noarchive=False)<\/p>\n<p>a.datas += [(&#8216;uiapp\/ui\/main.qml&#8217;, &#8216;ui\/main.qml&#8217;, &#8216;DATA&#8217;)]<\/p>\n<p>a.datas += [(&#8216;uiapp\/resources&#8217;, &#8216;ui\/resources&#8217;, &#8216;DATA&#8217;)]<\/p>\n<p>a.datas += [(&#8216;uiapp\/resources\/images&#8217;, &#8216;ui\/resources\/images&#8217;, &#8216;DATA&#8217;)]<\/p>\n<p>a.datas += [(&#8216;uiapp\/resources\/fonts&#8217;, &#8216;ui\/resources\/fonts&#8217;, &#8216;DATA&#8217;)]<\/p>\n<p>a.datas += [(&#8216;uiapp\/resources\/sounds&#8217;, &#8216;ui\/resources\/sounds&#8217;, &#8216;DATA&#8217;)]<\/p>\n<p>pyz = PYZ(a.pure, a.zipped_data<a href=\"https:\/\/appdabao.yimenapp.com\/jiage-34.html\">\u5957\u58f3app<\/a>,<\/p>\n<p>             cipher=block_cipher)<\/p>\n<p>exe = EXE(pyz,<\/p>\n<p>          a.scripts,<\/p>\n<p>          a.binaries,<\/p>\n<p>          a.zipfiles,<\/p>\n<p>          a.datas,<\/p>\n<p>          [],<\/p>\n<p>          name=&#8217;UIApp&#8217;,<\/p>\n<p>          debug=False,<\/p>\n<p>          bootloader_ignore_signals=False,<\/p>\n<p>          strip=False,<\/p>\n<p>          upx=True,<\/p>\n<p>          upx_exclude=[],<\/p>\n<p>          upx_include=[],<\/p>\n<p>          runtime_tmpdir=None,<\/p>\n<p>          console=False,<\/p>\n<p>          icon=&#8217;uiapp\/resources\/images\/app_icon.ico&#8217;)<\/p>\n<p>&#8220;`<\/p>\n<p>\u5176\u4e2d\uff0cAnalysis\u51fd\u6570\u7528\u4e8e\u6307\u5b9a\u6253\u5305\u7684\u5165\u53e3\u6587\u4ef6\u3001\u4f9d\u8d56\u5e93\u3001\u8d44\u6e90\u6587\u4ef6\u7b49\u7b49\uff0chiddenimports\u53c2\u6570\u7528\u4e8e\u6307\u5b9a\u9700\u8981\u6253\u5305\u7684\u4f9d\u8d56\u5e93\uff0cdatas\u53c2\u6570\u7528\u4e8e\u6307\u5b9a\u9700\u8981\u6253\u5305\u7684\u8d44\u6e90\u6587\u4ef6\uff0cname\u53c2\u6570\u7528\u4e8e\u6307\u5b9a\u6253\u5305\u540e\u7684\u5e94\u7528\u7a0b\u5e8f\u540d\u79f0\uff0cicon\u53c2\u6570\u7528\u4e8e\u6307\u5b9a\u5e94\u7528\u7a0b\u5e8f\u7684\u56fe\u6807\u3002<\/p>\n<p>4. \u6267\u884c\u6253\u5305\u547d\u4ee4<\/p>\n<p>\u5728\u4fee\u6539\u5b8c.spec\u6587\u4ef6\u540e\uff0c\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u6253\u5305\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>pyinstaller UIApp.spec<\/p>\n<p>&#8220;`<\/p>\n<p>\u6267\u884c\u5b8c\u4ee5\u4e0a\u547d\u4ee4\u540e\uff0c\u4f1a\u5728UIApp\u9879\u76ee\u7684\u6839\u76ee\u5f55\u4e0b\u751f\u6210\u4e00\u4e2adist\u6587\u4ef6\u5939\uff0c\u5176\u4e2d\u5305\u542b\u4e86\u53ef\u6267\u884c\u7684\u5e94\u7528\u7a0b\u5e8f\u6587\u4ef6\u3002<\/p>\n<p>\u81f3\u6b64\uff0cUIApp\u9879\u76ee\u5df2\u7ecf\u6210\u529f\u6253\u5305\u6210\u4e3a\u72ec\u7acb\u7684\u5e94\u7528\u7a0b\u5e8f\uff0c\u53ef\u4ee5\u5728\u6ca1\u6709Python\u73af\u5883\u7684\u60c5\u51b5\u4e0b\u8fd0\u884c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>UIApp\u662f\u4e00\u79cd\u57fa\u4e8ePython\u8bed\u8a00\u7684GUI\u5e94\u7528\u7a0b\u5e8f\u5f00\u53d1\u6846\u67b6\uff0c\u901a\u8fc7\u4f7f\u7528\u8be5\u6846\u67b6\uff0c\u53ef\u4ee5\u5feb\u901f\u5f00\u53d1\u51fa\u5177\u6709\u826f\u597d\u7528\u6237\u754c\u9762\u548c\u529f\u80fd\u7684\u5e94\u7528\u7a0b\u5e8f\u3002\u7136\u800c\uff0c\u5f00\u53d1\u51fa\u6765\u7684\u5e94\u7528\u7a0b\u5e8f\u4ec5\u9650\u4e8e\u5728Python\u73af\u5883\u4e0b\u8fd0\u884c\uff0c\u5982\u679c\u60f3\u8981\u5c06\u5176\u6253\u5305<\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[27533,13835,11,81,913],"topic":[],"class_list":["post-27099","post","type-post","status-publish","format-standard","hentry","category-sjapp","tag-phpapk","tag-app","tag-11","tag-81","tag-913"],"_links":{"self":[{"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/posts\/27099","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/comments?post=27099"}],"version-history":[{"count":1,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/posts\/27099\/revisions"}],"predecessor-version":[{"id":27259,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/posts\/27099\/revisions\/27259"}],"wp:attachment":[{"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/media?parent=27099"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/categories?post=27099"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/tags?post=27099"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/topic?post=27099"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}