Command prompt disappears with cx_freeze

拈花ヽ惹草 提交于 2019-12-24 10:45:54

问题


I am brand new to using cx_freeze for compiling Python files. I am trying to compile my program into an exe, and I need two txt files to go along with it. I am using this as my setup.py code:

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')]
)

When I run setup.py buld from cmd, and then run the program that it gives me, the command prompt window briefly opens then closes before I can read any text on it. What am I doing wrong?


回答1:


That code looks like it should work. What is the code you're trying to convert to exe?



来源:https://stackoverflow.com/questions/19472973/command-prompt-disappears-with-cx-freeze

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!