No idea whether it has to do with your problem, but if it's executable
in Windows, its name is snowball.exe, not snowball.
--
André Engels, andre...@gmail.com
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.
HTH.
Mark Lawrence.
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.
--
André Engels, andre...@gmail.com
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
Afolder
abc.py
hello.py
I now apply py2exe steps to produce an "executable" for abc. The folder
now changes to
Afolder
build
dist
abc.py
hello.py
build are two new folders. dist contains abc.exe.
Somehow when I type abc at the command prompt, this follows a path to
dist, and finds abc.exe, where it executes properly.
Cute, eh? I have no explanation for it.
I have no idea what build is for, but dist contains a bunch of other
files that possible apply to doing this with other files in the Afolder.
hello.py maybe. The details seem to be shrouded. Possible a Google might
provide a full explanation.
Are you sure it's executing abc.exe? If you are at a Python command
prompt within the "DOS shell" and you just type just abc, I think what
is happening is you are running abc.py, NOT abc.exe.
py2exe creates a dist folder (short for "distributables") by default
and puts your .exe into it along with whatever other files are needed
to run your application. Depending on how you set the bundling
options, this may be a lot of things or just 1-2 other things.
Che
So maybe the only way to execute the compiled code is to to to dist?
Not sure about that last question, but just try double-clicking on
the .exe file in dist and your app should run. In fact, copy that
dist folder to a flash drive, plug it into another computer that
doesn't have Python installed on it, and doubleclick it again--it'll
run again. In fact, depending on how you bundled it, you might need
only the .exe file on many computers that have the Windows dlls
already available.
Che
Or the compiled code needs to be in a folder that's higher in your
path settings than the python file.
But yes, moving into the dist directory, or running 'dist/snowball'
from the project root will do the trick.
That should, of course, be: 'dist\snowball' :)
There is a ludicrous setting in Windows explorer that hides the
extensions for known file types, such as .exe. If you see "snowball"
in Win Explorer, that's probably the way your system is set. If you
click on Tools . Folder Options . View you should see a checkbox for
the "Hide extensions for known file types" option. Uncheck it, and the
disappearing program will return to view.
This is a separate issue for why snowball.py executes when you enter
"snowball" at the command line.
--
rzed