[Distutils] Improving distutils' script and GUI app handling

Trent Mick trentm at ActiveState.com
Thu Sep 15 18:58:40 CEST 2005

I haven't yet played with setuptools/eggs/etc. so my comments might be

[Phillip J. Eby wrote]
> Then EasyInstall could create a 'unittest' script with a #! line on 
> Unix-like OSes, and a 'unittest.py', 'unittest.bat', or 'unittest.exe' on 
> Windows.  In each case, the generated program would simply load and run the 
> entry point with no arguments.

Effbot has some good things to say about/use for this:

> On Windows, I'd say that applications are pretty much always better as 
> .exe's, whether console or GUI.  The .py/.pyw form is dependent on a single 
> global consistent version of Python, but it's possible and reasonable to 
> have multiple Python versions installed.  An .exe also has a lot more 
> control over how Python is initialized, and that can be particularly 
> important for applications.  On the other hand, in the short run I can also 
> see using .bat or .cmd files for console apps, and .pyw for GUI apps, just 
> to have something that works and wait for the path management use cases for 
> various .exe options to work themselves out.

There is a bug in the current cmd.exe (or maybe it is only up to Win2k?
can't remember) where shell redirection doesn't work if your script is
launched indirectly via a .bat of .cmd file. As well, Ctrl+C signal
handling for kill a script is quite annoying if launched via a .bat
file: you get a secondary question from the shell

    Terminate batch file (Y/N)?

or something like that. A .exe launcher/stub is definitely preferred.


Trent Mick
TrentM at ActiveState.com

More information about the Distutils-SIG mailing list