cx_Freeze 没有正确地将 python 程序转换为可执行文件
cx_Freeze not correctly converting python program(s) into executable
我在 pygame 中有一个项目的以下文件:
> extras.py
> main.py
> settings.txt
# main.py imports extras.py
我正在尝试使用 cx_Freeze
转换为可执行文件。
我的setup.py
文件如下
from cx_Freeze import setup, Executable
executables = [Executable("main.py")]
setup(
name = 'Pong',
author = 'Ethan',
options={
"build_exe": {
"packages":["pygame", "sys", "random"],
"include_files":["settings.txt"]
}},
executables = executables,
version = "5.1.1"
)
它构建时没有错误,但是在 运行 之后 exe
它启动 window 然后立即关闭。我得到了一个要构建的 python 文件,但不知道如何构建多个。
使用:
executables = [Executable("main.py"), Executable("extras.py")]
我在 pygame 中有一个项目的以下文件:
> extras.py
> main.py
> settings.txt
# main.py imports extras.py
我正在尝试使用 cx_Freeze
转换为可执行文件。
我的setup.py
文件如下
from cx_Freeze import setup, Executable
executables = [Executable("main.py")]
setup(
name = 'Pong',
author = 'Ethan',
options={
"build_exe": {
"packages":["pygame", "sys", "random"],
"include_files":["settings.txt"]
}},
executables = executables,
version = "5.1.1"
)
它构建时没有错误,但是在 运行 之后 exe
它启动 window 然后立即关闭。我得到了一个要构建的 python 文件,但不知道如何构建多个。
使用:
executables = [Executable("main.py"), Executable("extras.py")]