Problems running a compiled script on Windows.

Peter Hansen peter at engcorp.com
Mon Aug 13 02:30:50 CEST 2001


Wayne wrote:
> 
> I just finished a program/script and compiled it (can't have an
> interpreter on the dest. machine).  When I run the .py from the
> command line it works fine, however, when I run the .exe from the
> command line it doesn't work.  It also doesn't work when I run it from
> Explorer.

Always describe *how* something doesn't work.  What are the
symptoms?  Does the computer crash?  Does nothing appear to 
happen?  Does everything work *except* some minor part of 
the logic?  It could be any of these or a zillion other things.
(Describing what "works fine" means in the case of your
program might be of some help, too.)

Also, there is no standard Python way to create .exe files 
on Windows.  Which method did you use?

You imply that even the .py doesn't work from Explorer.  Maybe
the issue has nothing to do with the .exe, and everything to
do with a problem related to the reason it won't run in 
Explorer.  Are you perhaps looking at two different problems?
(If you run a .py from Explorer, it just opens a console 
anyway.  Were you running it as a .pyw, or invoking pythonw
directly, or was this whole assumption wrong?)

> I'm using Active Python 2.1.1 with Qt on Win2K.  I've tried to find
> all the instances of stdout and stderr that might require console.

Neither stdout nor stderr *require* the console.  That is, the program 
will run fine without a console, other than that any output sent to
those files will not appear anywhere, which could obviously
prevent some programs from appearing to work.  Is your program 
failing in some other way, and you are assuming it is because
you have prints which can't "go" anywhere?  I'm not sure
there is enough information in your post to point out an obvious
place to look for a fix... (of course, that has rarely stopped
some people in this group from providing useful and correct 
answers, but it might help a little :-)

-- 
----------------------
Peter Hansen, P.Eng.
peter at engcorp.com



More information about the Python-list mailing list