Hiding console with program compiled in PY2EXE

M

Marc

Hi all,

I know that to hide a console normally you simply change the extension
from .py to .pyw. That's simple enough. However I can't seem to
accomplish the same thing after freezing the program. I've tried
building the setup file with the python script as a .pyw file, but it
crashes and doesn't give me a reason. This is of course because the
debug window doesn't open, so you don't know what happened (ahh, the
irony).

Does anyone know how to successfully freeze a program with py2exe?

Many thanks,
Marc
 
D

duikboot

# setup.py
from distutils.core import setup
import py2exe

setup(name="convertdpi",
scripts=["convertdpi.pyw"],
)


From the dos command prompt:
c:\python23> python.exe setup.py py2exe

This works for me.

Hope it helps,

Arjen
 
?

=?ISO-8859-1?Q?J=F8rgen_Cederberg?=

duikboot said:
# setup.py
from distutils.core import setup
import py2exe

setup(name="convertdpi",
scripts=["convertdpi.pyw"],
)


From the dos command prompt:
c:\python23> python.exe setup.py py2exe

Hi

or instead

# setup.py
from distutils.core import setup
import py2exe
setup(name="convertdpi",
scripts=["convertdpi.py"],
)

c:\python23> python.exe setup.py py2exe -w

Which works for me :)

All options are described on http://starship.python.net/crew/theller/py2exe/

Regards
Jorgen
 
A

Anand Pillai

The way to prevent a py2exe program from throwing up
a console is to pass the '--windows' option to it.

i.e change your py2exe command line from

%python setup.py py2exe

to

%python setup.py py2exe --windows

HTH.



-Anand
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top