I used distutils to install my python package, with this setup.py :
import distutils.core
args = {
name : plugh ,
version : 1.0 ,
scripts : [ "scripts/plugh" ],
packages : [ "plugh" ],
}
d = distutils.core.setup(
**args
)
On linux/mac, it works as expected:
% plugh
hello world
%
On windows, the script "plugh" does not run:
C:Python25Scripts>plugh
plugh is not recognized as an internal or external command,
operable program or batch file.
C:Python25Scripts>
I found the bug report at http://bugs.python.org/issue7231 that the Scripts directory is not added to PATH when you install python, so I applied the workaround described in that ticket (i.e. add C:Python25Scripts to PATH)
C:Python25Scripts>path
PATH=c:Python25Scripts;C:Program FilesLegato
srin;C:WINDOWSsystem32;C:
WINDOWS;C:WINDOWSSystem32Wbem;C:Program FilesQuickTimeQTSystem;c:python2
5;c:local;C:WINDOWSsystem32WindowsPowerShellv1.0
Is this something that just doesn t work on Windows? And if so, how exactly are you supposed to use python scripts on a windows machine?
I suppose that I could detect Windows, and add an additional script to the list, called "plugh.bat" containing something like:
@echo off
c:python25python.exec c:python25scriptsplugh %1 %2 %3 %4 %5 %6 %7 %8 %9
but is that really the right answer here? I would have thought that with all the customizations that distutils contains for windows, there would be a better answer than that.