Great. That worked.Here is my code:# Import system modules
import sys, string, os, arcgisscripting
# Create the Geoprocessor object
gp = arcgisscripting.create(9.3)
gp.overwriteoutput = 1
# Load required toolboxes...
gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx")
# Set workspace
gp.workspace = "C:\\geodata\\PRIO_GRID\\Data_Sources\\cShapes0.24\\"
# Create list
yearlist = list(range(1946, 2009))
# Define emptygrid
emptygrid = "C:\\geodata\\PRIO_GRID\\Data_Sources\\EmptyGrid\\emptygrid230610_WGS.shp"
# Select cShapes year and copy each year to new shapefile
for x in yearlist:
query ="GWSYEAR <= " + str(x) + " " + "AND" + " " + "GWEYEAR >= " + str(x)
gp.MakeFeatureLayer("cshapes.shp","lyr")
gp.SelectLayerByAttribute("lyr", "new_selection", query)
gp.CopyFeatures("lyr", "cshapes"+str(x))
del yearlist, query, x, emptygrid
print "completed"