Python cx_Freeze for two or more python files (modules)

后端 未结 1 1890
無奈伤痛
無奈伤痛 2020-12-21 02:22

There are example to build executable using one py file(module) as given here I have about 4 py files(modules), I would like to build executable which should include all the

相关标签:
1条回答
  • 2020-12-21 02:58

    If your hello.pyfile import those files - hello1.py and hello2.py, then this line:

    executables = [Executable("hello.py")])
    

    is quite enough.

    But if any of those files are separate script file, then you should do like this:

    from cx_Freeze import setup, Executable
    
    setup(
            name = "hello",
            version = "0.1",
            description = "the typical 'Hello, world!' script",
            executables = [Executable("hello.py"), Executable("hello1.py"), Executable("hello2.py")]
    )
    

    It will create 3 .exe files, for each one of your scripts.

    0 讨论(0)
提交回复
热议问题