修改打包配置

This commit is contained in:
halliday2023 2024-02-13 22:00:14 +08:00
parent b462565294
commit 137558064a
1 changed files with 3 additions and 28 deletions

View File

@ -2,9 +2,8 @@
block_cipher = None block_cipher = None
a = Analysis(['bin\\DataCreating_Click.py'], a = Analysis(['bin\\DataCreating_Click.py'],
pathex=['E:\\git-code\\dataCreatingGUI'], pathex=[],
binaries=[], binaries=[],
datas=[], datas=[],
hiddenimports=['PySide6.QtXml'], hiddenimports=['PySide6.QtXml'],
@ -15,40 +14,16 @@ a = Analysis(['bin\\DataCreating_Click.py'],
win_private_assemblies=False, win_private_assemblies=False,
cipher=block_cipher, cipher=block_cipher,
noarchive=False) noarchive=False)
#######!!!注意点1加载自己的资源文件#####################
def extra_datas(mydir):
def rec_glob(p, files):
import os
import glob
for d in glob.glob(p):
if os.path.isfile(d):
files.append(d)
rec_glob("%s/*" % d, files)
files = []
rec_glob("%s/*" % mydir, files)
extra_datas = []
for f in files:
extra_datas.append((f, f, 'DATA'))
return extra_datas
# append the 'Resources' dir
a.datas += extra_datas('etc') ###这里是自己的资源文件夹
a.datas += extra_datas('ui') ###这里是自己的资源文件夹
################################################
pyz = PYZ(a.pure, a.zipped_data, pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher) cipher=block_cipher)
exe = EXE(pyz, exe = EXE(pyz,
a.scripts, a.scripts,
[], [],
exclude_binaries=True, ###!!!注意点3这里是True exclude_binaries=True,
name='dataCreatingGUI', name='dataCreatingGUI',
debug=False, debug=False,
bootloader_ignore_signals=False, bootloader_ignore_signals=False,