Search code examples
pythonpy2exe

Compiling with Py2Exe - Black Box Error


When trying to compile a GUI program using Py2Exe, whenever I load the GUI, a black box appears behind it.

Is there anyway to prevent this?


Solution

  • In your py2exe script, specify windows=['myscript.py'], instead of console=['myscript.py'],

    Like so:

    setup(
            windows=['myscript.py'],
            options={
                    "py2exe":{
                            "unbuffered": True,
                            "optimize": 2,
                    }
            }
    )
    

    See py2exe List Of Options