py2exe saga continues...

Mark Hammond skippy.hammond at
Fri Apr 16 03:10:42 CEST 2010

On 16/04/2010 10:52 AM, Alex Hall wrote:
> 1. Is there a way to start with no command line window popping up? My
> main script is a pyw, but it still shows a dos window when the
> generated .exe file is clicked. Leaving out the "console" parameter of
> setup, though, results in no .exe file at all, so I had to put it
> back. I want what I have heard called a "silent startup", where the
> program starts but it does not pop up anything. My users will know
> because I will speak a message, but I want to dump the dos window.

You probably want to use the 'windows=' option instead of the 'console=' 
option (or both if you like - in which case you probably also need to 
specify a 'dest_base' value for one of them.

> 2. Is there a way to put the exe in a higher-level dir, then put all
> the pyd, dll, zip, and other files into a subdirectory so the .exe is
> not mixed in with all these files that most users will not care about?
> Thank you for all your help over the last few days!!

I *think* that if you specify the 'zipfile' param to include a directory 
portion then all libs will be stored in that same dir.  Eg, spambayes 

       zipfile = "lib/spambayes.modules",

which causes the .zip file to be named as specified, but all the .pyd 
files also wind up in the 'lib' directory.  Use of the 'dest_base' param 
causes all executables to be placed in a 'bin' directory, so we have 2 
separate dirs holding things.  Spambayes has a complicated setup file 
which may offer some insights - find the spambayes source at sourceforge 
then look for the spambayes/spambayes/windows/py2exe/ file 
for inspiration...



More information about the Python-list mailing list