In the following code (c attachment also)

import pylab as P
from yt.mods import *
pf = load("RD0002/RedshiftOutput0002")

c = pf.h.find_max('Density')[1]
proj = pf.h.proj(1, 'Density')

width = 96/pf['mpc'] # we want a 1.5 mpc view
res = [1000, 1000] # create an image with 1000x1000 pixels
frb = proj.to_frb(width, res, center=[0.5,0.5,0.5])

P.imshow(frb['Density'])
P.xlabel(r'$x\ \mathrm{kpc}$')
P.ylabel(r'$x\ \mathrm{furlongs}$')
P.savefig('Density_y.png')


My problem is to develop a new code which automatically take `n' input files (RD0001/RedshiftOutput0001, RD0002/RedshiftOutput0002, RD0003/RedshiftOutput0003, ....)    and want to save each output files in a folder.



Please help me.....

--
Reju Sam John