打包文件
This commit is contained in:
62
build_exe.spec
Normal file
62
build_exe.spec
Normal file
@@ -0,0 +1,62 @@
|
||||
# -*- mode: python ; coding: utf-8 -*-
|
||||
"""
|
||||
PyInstaller 配置文件
|
||||
可以直接使用: pyinstaller build_exe.spec
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
block_cipher = None
|
||||
|
||||
# 收集所有需要打包的Python文件
|
||||
a = Analysis(
|
||||
['main.py'],
|
||||
pathex=[],
|
||||
binaries=[],
|
||||
datas=[
|
||||
('fabric_library.db', '.') if os.path.exists('fabric_library.db') else None,
|
||||
],
|
||||
hiddenimports=[
|
||||
'PyQt5.QtCore',
|
||||
'PyQt5.QtGui',
|
||||
'PyQt5.QtWidgets',
|
||||
'sqlite3',
|
||||
],
|
||||
hookspath=[],
|
||||
hooksconfig={},
|
||||
runtime_hooks=[],
|
||||
excludes=[],
|
||||
win_no_prefer_redirects=False,
|
||||
win_private_assemblies=False,
|
||||
cipher=block_cipher,
|
||||
noarchive=False,
|
||||
)
|
||||
|
||||
# 过滤掉None值
|
||||
a.datas = [d for d in a.datas if d is not None]
|
||||
|
||||
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
|
||||
|
||||
exe = EXE(
|
||||
pyz,
|
||||
a.scripts,
|
||||
a.binaries,
|
||||
a.zipfiles,
|
||||
a.datas,
|
||||
[],
|
||||
name='服装布料计算管理器',
|
||||
debug=False,
|
||||
bootloader_ignore_signals=False,
|
||||
strip=False,
|
||||
upx=True,
|
||||
upx_exclude=[],
|
||||
runtime_tmpdir=None,
|
||||
console=False, # 不显示控制台窗口
|
||||
disable_windowed_traceback=False,
|
||||
argv_emulation=False,
|
||||
target_arch=None,
|
||||
codesign_identity=None,
|
||||
entitlements_file=None,
|
||||
icon=None, # 可以指定图标文件路径,例如: 'icon.ico'
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user