Steven Matthews
Steven Matthews

Reputation: 11285

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?

Upvotes: 0

Views: 115

Answers (2)

g.d.d.c
g.d.d.c

Reputation: 47988

You need to use the windows option to Setup rather than the console option.

setup(
#  windows = [RPMApp],
  console = [RPMApp, DBMigrate],
  zipfile = 'common.bin',
  options = options,
  data_files = files,
  cmdclass = {'py2exe': FileCollector}
)

Here, I actually have the console enabled for debugging, but I'll uncomment the windows option when I finish building for deployment.

Upvotes: 2

chown
chown

Reputation: 52738

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

Upvotes: 2

Related Questions