0

I made a simple interface using PyQt and now I'm trying to deliver an executable using py2exe.

The following setup.py script works fine:

from distutils.core import setup
import py2exe

setup(console=['main.py'], options={"py2exe":{"includes":["sip"]}})

but when I use windows=[] instead of console=[] I get the error: [WinError87] The parameter is incorrect.

Is there an easy solution to this problem so I don't have to use the console.

By the way I'm running py2exe version 0.9.2.2, Python 3.4, Python User Interface Compiler 4.11.3 for Qt version 4.8.6.

Hope someone can help, thanks!

isar
  • 1,661
  • 1
  • 20
  • 39

2 Answers2

0

Save your main file as main.pyw and py2exe will automatically hide de console.

cdonts
  • 9,304
  • 4
  • 46
  • 72
  • Thanks for answering... I tried but the console is still there, behind the Main Window – isar Mar 07 '15 at 16:31
0

Try:

setup(windows=['main.py'], options={"py2exe":{"includes":["sip"]}})

If not. Do like cdonts said. rename main.py to main.pyw. .pyw indicates it should be interpreted by pythonw.exe and not python.exe. Which prevents commandline window popping up.