The Disappearing Program?

CM cmpython at gmail.com
Sat Feb 20 05:59:55 CET 2010


On Feb 19, 4:42 pm, "W. eWatson" <wolftra... at invalid.com> wrote:
> On 2/19/2010 10:56 AM, CM wrote:
>
> > On Feb 19, 12:21 pm, "W. eWatson"<wolftra... at invalid.com>  wrote:
> >> On 2/19/2010 7:16 AM, Mark Lawrence wrote:>  Andre Engels wrote:
> >>>> On Fri, Feb 19, 2010 at 3:19 PM, Mark Lawrence
> >>>> <breamore... at yahoo.co.uk>  wrote:
> >>>>> Andre Engels wrote:
> >>>>>> On Fri, Feb 19, 2010 at 12:20 PM, W. eWatson<wolftra... at invalid.com>
>
> >> ...
> >> tories, or even the whole hard drive, for snowball.*. Then the OP>  would know exactly what he has or hasn't got.
>
> >>> HTH.
>
> >>> Mark Lawrence
>
> >> Here's the answer. Consider this folder.
>
> >> 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.
>
> > 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
>
> Well, you are right. What proof do I have? In fact, I just tried to run
> a program that was not converted, and left off py. It worked.
>
> 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



More information about the Python-list mailing list