PDA

View Full Version : [SOLVED] py2exe Hide Console



themusicwave
March 18th, 2008, 08:23 PM
I'm using Py2Exe to turn a python program into a Windows exe. I know this is probably not a popular idea, but I have to do it since I cannot be sure the computer will have python on it.

Rest assured that the first thing that this exe does is install python 2.5 and setup the python path environment variable. This way in the future I can assume python will be there!

Anyways, the problem is that even though it's a GUI App built on TK, it still shows the console when compiled with Py2Exe. I even tried changing the extensions to .pyw

Any ideas? I know most of us don't like Windows XP, but sadly my employer does not share that feeling...

Quikee
March 18th, 2008, 10:59 PM
I had the same problem today (however I was using pygtk). I changed app.py to app.pyw and modify the "setup.py" py2exe script from:


from distutils.core import setup
import py2exe
setup(console=['app.py'])

to:


from distutils.core import setup
import py2exe
setup(windows=['app.py'])

I hope it helps.

themusicwave
March 19th, 2008, 12:59 PM
That worked, thanks!