zhuguifei
2025-06-17 c1cc49dd93d38f51790558541d6835d1598ecccf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from cx_Freeze import setup, Executable
 
# 创建可执行文件的配置
executableApp = Executable(
    script="main.py",
    target_name="pyapp",
)
 
# 打包的参数配置
options = {
    "build_exe": {
        "build_exe":"./dist/",
        "excludes": ["*.txt"],
        "optimize": 2,
    }
}
 
setup(
    name="pyapp",
    version="1.0",
    description="python app",
    options=options,
    executables=[executableApp]
)