-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.py
More file actions
27 lines (23 loc) · 819 Bytes
/
Copy pathbuild.py
File metadata and controls
27 lines (23 loc) · 819 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import PyInstaller.__main__
import os
# 获取当前脚本所在目录(即项目根目录)
base_dir = os.path.dirname(os.path.abspath(__file__))
# 构造打包参数
args = [
'--onedir',
'--noconsole',
'--name', 'DiffExplorer',
'--icon', 'favicon.ico',
'--add-data', 'favicon.ico;.',
'--add-data', f'{os.path.join(base_dir, "R-Portable")}{os.pathsep}R-Portable',
'--add-data', f'{os.path.join(base_dir, "run_stats.R")}{os.pathsep}.',
'--hidden-import', 'PIL',
'--hidden-import', 'pandas',
'--hidden-import', 'openpyxl',
'--hidden-import', 'matplotlib',
'--hidden-import', 'numpy',
os.path.join(base_dir, 'ui_main.py')
]
# 执行打包
PyInstaller.__main__.run(args)
print("\n打包完成!exe 位于 dist/DiffExplorer/ 目录下")