[Tutor] Wrestling with the Py2exe Install, Win7[XP!], Py2.5

Alan Gauld alan.gauld at btinternet.com
Fri Feb 19 20:44:35 CET 2010


"Wayne Watson" <sierra_mtnview at sbcglobal.net> wrote
> pylab_scatter.exe. Interestingly, if I fire it up from the Win folder, a 
> dos-window appears and it dies. A few lines appear too quickly to read. 
> If I execute it from the command prompt, it works fine. Still the mystery 
> to me is why I don't need to add exe in the cmd prompt to execute it.

DOS(*) automatically looks for executable file extensions (exe,com, bat 
etc)
so you don't need to type them. You don't type cmd.exe to start a DOS
shell do you? You only type cmd... I hope!

(*)Actually the Windows command processor CMD.EXE

> Further, how did it know to look in the dist folder?

Thats more interesting!
It presumably added dist to the PATH environment variable. Not
the Python path the DOS one - after all the EXE is not a python
program any more its an exe file running under DOS.

>  I have a  comment about the tutorial.
> The command line shown a few lines into section 3. does not need python 
> in the line in my case. setup.py py2exe works.

That only works because you have the file asociation set to
recognise .py files as associated with the interpreter.  Using python
explicitly removes that potential trip wire and so for a tutorial writer
makes it a much safer option.

HTH,

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/ 




More information about the Tutor mailing list