Here is a piece of code I use a lot for shapefiles and raster files. Let me know if you would like more info.
import os, arcpy
# Input Folder
inputFolder = r"yourfolderpath"
# Output Folder
outputFolder = r"youroutfolderpath"
for inputFilename in os.listdir(inputFolder) :
if inputFilename.endswith('.shp') :
inputPath = os.path.join(inputFolder, inputFilename)
outputPath = os.path.join(outputFolder, inputFilename)
gp.Clip_analysis(ENTER PARAMETERS)
print "End of processing."
import os, arcpy
from arcpy import env
# Input Folder
inputFolder = r"yourfolderpath"
env.workspace = inputFolder
# Output Folder
outputFolder = r"youroutfolderpath"
rasterList = arcpy.ListRasters("", "GRID")
for raster in rasterList:
inputPath = os.path.join(inputFolder, raster)
outputPath = os.path.join(outputFolder, raster)
print "End of processing."
Good Luck! Lacey
... View more