我在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
时它启动一个窗口然后立即关闭。我已经有一个python文件要构建,但无法弄清楚如何做多个。
使用:
executables = [Executable("main.py"), Executable("extras.py")]