thanks for the encouragement!

You should check out in the py2exe distribution.  You should
clone that file, and implement whatever semantics you like.  You'll then
probably need to dig into to work out how to arrange for a
custom boot script - you would then specify your modified version.

I went down that path, and it worked out beautifully. At least the customizing of boot scripts and monkey-patching build_exe. The design of build_exe is great to patch in, big WOWs to Thomas and all who did jobs.

HOWever, I learned (guess you know that, I just want to put this knowledge somewhere googleable):

a) the "custom_boot_script" option of py2exe only adds an ADDITIONAL boot_script, not a replacement. So if something happens in that someone not likes, it will not be undone by custom_boot_script; but by overloading get_boot_script()

b) using pywin32 command style for the service works much more harmonic and beautifull.

I recommend to have pywin32 command style for services as default for the next py2exe version

> An alternative would be to see if you can make a "custom" command-line arg scheme work for you - should >give you enough pointers there too.
>I hope that helps - let us know if you get stuck.

It helped. And I got stuck quite outside of this ... on a much more challenging level:

When creating a service, py2exe uses "python", not "pythonw" as a building base. That is good, because it gives a console to put out messages.

That is bad, because it gives a console :)

So, my goal is: to have myprogram.exe, which:

a) does not give a console if started as  myprogram.exe --whateverparm
b) does give a console if startet as myprogram.exe --whateverotherparm

I can do the parsing of the --whateverparms with modifying


a) if using python as base, a console is allready there, and: I do know no way of getting rid
b) if using pythonw as base, a console is not available, and I could not find a way of creating one (or using the "parent" one, if the .exe is started from cmd.exe) and connect stdout to it.

Any hint, idea, reading material or solution?

Thanks for all the tools and help so far,


GHUM Harald Massa
persuadere et programmare
Harald Armin Massa
Reinsburgstraße 202b
70197 Stuttgart
fx 01212-5-13695179
Python: the only language with more web frameworks than keywords.