py2exe saga continues...

Alex Hall mehgcap at
Fri Apr 16 05:01:54 CEST 2010

On 4/15/10, Mark Hammond <skippy.hammond at> wrote:
> 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.
Yes, that did it!
>> 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
> includes:
>        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.
I found that setting zipfile to None gets rid of an unnecessary (as
far as I can tell) .zip file; specifying another name did not do
anything, though it did not give me an error either.
> 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...

Oddly, I set the --bundle flag to 1, then 2, but in both cases my
program had a memory error. When the bundle flag was left out, I have
no errors and things work as expected. In either case, though, I get a
dist folder of nearly 21mb in size, much larger than I ever imagined!
I use wx, wmi, win32con, and ctypes (and other libs, but they are
small). Is there any way of optimizing things so that I can get the
overall size down some?
> HTH,
Yes, it helped a lot.
> Mark.

Have a great day,
Alex (msg sent from GMail website)
mehgcap at;

More information about the Python-list mailing list