我是使用 cx_freeze 编译 Python 文件的新手。我正在尝试将我的程序编译成一个 exe,我需要两个 txt 文件来配合它。我使用它作为我的 setup.py 代码:
from cx_Freeze import setup, Executable
includesfiles = ['textone.txt', 'texttwo.txt']
includes = []
excludes = []
packages = []
setup(
name = "Program",
version = "0.1",
description = "A fun game.",
author = "author",
options = {'build_exe': {'excludes':excludes,'packages':packages,'include_files':includesfiles}},
executables = [Executable('program.py')]
)
当我setup.py buld
从 cmd 运行,然后运行它给我的程序时,命令提示符窗口会短暂打开然后关闭,然后我才能阅读其中的任何文本。我究竟做错了什么?