繁体   English   中英

命令提示符随cx_freeze消失

[英]Command prompt disappears with cx_freeze

我是第一次使用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')]
)

当我从cmd运行setup.py buld ,然后运行它提供的程序时,命令提示符窗口会短暂打开,然后关闭,然后我才能读取其中的任何文本。 我究竟做错了什么?

该代码看起来应该可以工作。 您要转换为exe的代码是什么?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM