I want to automatically input some files that have names as in array “dates” and then save them after some operations but the code is not working:
dates=[20120711,20120712,20120713,20120714,20120715]
DEM="C:\\Path\\iranDem.tif"
for i in dates:
Norma="C:\\Temporar\\%d.tif"
JoNorma="C:\\%d.tif"
Delta=arcpy.sa.Times(DEM,0.0065)
JoNorma=arcpy.sa.Minus(Norma,Delta)
% i
You need to put the
%operator in the correct locations:You cannot just put the
% ion a separate line, the operator requires a string to operate on.I corrected the indentation of your post, but I suspect that you don’t realize that in Python, indentation is crucial. You need to make sure that all the lines that are part of the loop, are indented properly as is now displayed in your question.