Okay: got it wired using both of your suggestions. Here's the final script
import arcpy
from arcpy.sa import *
import os
inDir = r'C:\JoesStuff\SouthernImages'
#outWS = r'C:\JoesStuff\SouthernImages\SlopeRasters' # to a folder
outWS = r'C:\JoesStuff\SouthernImages\Rasters.gdb' # to a gdb
imageList = ['C:\\JoesStuff\\SouthernImages\\12TVK1276.tif',
'C:\\JoesStuff\\SouthernImages\\12TVK1474.tif',
'C:\\JoesStuff\\SouthernImages\\12TVK1476.tif',
'C:\\JoesStuff\\SouthernImages\\12TVK1674.tif',
'C:\\JoesStuff\\SouthernImages\\12TVK1676.tif',
'C:\\JoesStuff\\SouthernImages\\12TVK1874.tif',
'C:\\JoesStuff\\SouthernImages\\12TVK1876.tif',
'C:\\JoesStuff\\SouthernImages\\12TVK1877.tif',
'C:\\JoesStuff\\SouthernImages\\12TVK1976.tif',
'C:\\JoesStuff\\SouthernImages\\12TVK1977.tif',
'C:\\JoesStuff\\SouthernImages\\hh12TVK1200076000.img',
'C:\\JoesStuff\\SouthernImages\\hh12TVK1200078000.img',
'C:\\JoesStuff\\SouthernImages\\hh12TVK1400076000.img',
'C:\\JoesStuff\\SouthernImages\\hh12TVK1400078000.img',
'C:\\JoesStuff\\SouthernImages\\hh12TVK1600076000.img',
'C:\\JoesStuff\\SouthernImages\\hh12TVK1600078000.img',
'C:\\JoesStuff\\SouthernImages\\hh12TVK1800074000.img',
'C:\\JoesStuff\\SouthernImages\\hh12TVK1800076000.img',
'C:\\JoesStuff\\SouthernImages\\hh12TVK1800078000.img']
for i in enumerate(imageList):
inRaster = i[1]
outName = f'Slope{i[0]}' # f'Slope{i[0]}.tif'
outRaster = f'{outWS}\{outName}'
outMeasurement = 'PERCENT_RISE'
zFactor = 1
method = 'PLANAR'
zUnit = 'METER'
outSlope = Slope(inRaster, outMeasurement, zFactor, method, zUnit)
outSlope.save(outRaster)
I read an article earlier today suggesting enumerate() instead of range() in a for loop and went that route. Line 33
can go to an FGDB grid or TIF image depending on which line (6 or 7) is executed.
So in essence you both answered my question so I'll let you duke it out for bragging rights and just assign it 'Assumed Answered'... ![](https://community.esri.com/legacyfs/online/emoticons/wink.png)
That should just about do it....