I've had several occasions when a python program seems to loop through twice. Below is an example:
from os import walk import subprocess f = [] x = "" for (dirpath, dirnames, filenames) in walk('.'): f.extend(filenames) f.sort() for x in f: if x[-3:]=='JPG': print(x) args = "convert " + x + " -rotate " + "-90 " + x subprocess.call(args, shell=True) This program should rotate a jpg file by 90 degrees left. It actually rotates the file 180 degrees and the print(x) function prints the file name twice. What am I doming wrong. I run it as python rotate.py from the command line. Gary R. ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 _______________________________________________ Pydev-users mailing list Pydev-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pydev-users