#!/usr/bin/env python #cd chunked # ##for file in *.tif #for file in chunk_3_-2.tif chunk_4_-2.tif #do # echo $file # base=`basename "$file"` # output="${base}.jpg" # #if [ -e "${output}" ] # if ( /bin/false ) # then # echo exists # else # convert -scale 10% "$file" "${output}" # fi # #done import glob import os for filename in glob.glob('chunked/*.tif'): basename = filename[:-4] print basename command = 'convert -scale 100%% "%s" "%s.jpg"' % (filename, basename) print command #os.system(command) command = 'convert -scale 1%% "%s" "%s_tn.jpg"' % (filename, basename) print command #os.system(command) command = '/usr/lib/python2.3/site-packages/rgb2pct.py "%s" "%s_8bit.tif"' % (filename, basename) print command os.system(command)