简体   繁体   中英

cx_Freeze not correctly converting python program(s) into executable

I have the following files for a project in pygame:

> extras.py

> main.py

> settings.txt

# main.py imports extras.py

I am trying to convert into an executable using cx_Freeze .

My setup.py file is as follows

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"
)

It builds without errors but upon running the exe it launches a window then immediately closes. I have gotten a single python file to build but can't figure out how to do multiple.

采用:

executables = [Executable("main.py"), Executable("extras.py")]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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