[Tutor] Python loop isn't working

Alan Gauld alan.gauld at btinternet.com
Fri Aug 5 19:20:57 CEST 2011

On 05/08/11 17:14, Susana Iraiis Delgado Rodriguez wrote:

> The module works fine from Python command line and Pyton IDLE, but I
> need this program to run from MS-DOS, when I added the try statement it
> started to fail. Module runs but doesn't do what I need. Console shows:
> C:\Python26>shp2png.py C:\\ .png
> Iniciando...
> Listo
> What am I doing wrong?

What makes you think it doesn't work?
The first pruint is near the start of your code, the last near the end.
So your program appears to have run.

What else were you expecting to see happen?
What is different when you run it from "Python command line"?

In practice there should be no difference between you typing

C:\Python26>shp2png.py C:\\ .png

and typing

C:\Python26> python shp2png.py C:\\ .png

Or are you doing something at the Python >>> prompt?
If so what? How are you "running" it when it works?

Alan G.

More information about the Tutor mailing list