问题
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