The Disappearing Program?

Mark Lawrence breamoreboy at yahoo.co.uk
Fri Feb 19 16:16:20 CET 2010


Andre Engels wrote:
> On Fri, Feb 19, 2010 at 3:19 PM, Mark Lawrence <breamoreboy at yahoo.co.uk> wrote:
>> Andre Engels wrote:
>>> On Fri, Feb 19, 2010 at 12:20 PM, W. eWatson <wolftracks at invalid.com>
>>> wrote:
>>>> I've successfully compiled several small python programs on Win XP into
>>>> executables using py2exe. A program goes from a name like snowball.py to
>>>> snowball. A dir in the command prompt window finds snowball.py but not
>>>> snowball. If I type in snowball, it executes. What's up with that?
>>> No idea whether it has to do with your problem, but if it's executable
>>> in Windows, its name is snowball.exe, not snowball.
>>>
>> Not necessarily, it's perfectly possible to setup a Python script to run on
>> Windows using file associations in the same way that you can run a command
>> (.bat) file.  If the OP types the command "ASSOC .py" without the quotes at
>> the command prompt, the response .py=Python.File tells you
>> that this association has been setup.
> 
> And how does that invalidate what I wrote? One cannot associate the
> empty extension, so if "snowball" runs a program, that's the program
> in the file "snowball.exe" not the program in the file "snowball" that
> has its extension associated to something - it has no extension, so
> its extension cannot be associated.
> 

Darn, only half the story, sorry.  When the OP types snowball something 
executes.  The command SET PATHEXT will show what file extensions are 
set to run files.  On my system the response is :-

c:\Users\Mark\Java2Python>set pathext
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY

So snowball with any one of the 12 extensions listed above would run on 
my system without actually typing the extension.  I'm just  guessing but 
has an executable been created but in another directory, so snowball.py 
is running?  Perhaps the best bet is simply to search appropriate 
directories, or even the whole hard drive, for snowball.*.  Then the OP 
would know exactly what he has or hasn't got.

HTH.

Mark Lawrence




More information about the Python-list mailing list