ShapenameList00 = ["Cover88","Cover91"]
print(ShapenameList00)
['Cover88', 'Cover91']
print(Data)
C:\Users\jasherer\.0\PythonProject\Data
print([Data])
['C:\\Users\\jasherer\\.0\\PythonProject\\Data']
print(LandCover)
C:\Users\jasherer\.0\PythonProject\gdb0YS.gdb\LandCover
print([LandCover])
['C:\\Users\\jasherer\\.0\\PythonProject\\gdb0YS.gdb\\LandCover']
The following (and other versions without changing the out_name parameter) hit "RuntimeError: Object: Error in executing tool" when running from the Python window in ArcGIS Pro 3.1.0:
arcpy.env.workspace = Data
arcpy.ListFeatureClasses()
['landcover_1988.shp', 'landcover_1991.shp', ...]
ShapefileList00 = ["landcover_1988.shp","landcover_1991.shp"]
for EachShp in ShapefileList00:
arcpy.conversion.FeatureClassToFeatureClass(
in_features = EachShp,
out_path = LandCover,
out_name = ShapenameList00
)ShapefileList00 = [os.path.join(Data,"landcover_1988.shp"),os.path.join(Data,"landcover_1991.shp")]
print(ShapefileList00)
['C:\\Users\\jasherer\\.0\\PythonProject\\Data\\landcover_1988.shp', 'C:\\Users\\jasherer\\.0\\PythonProject\\Data\\landcover_1991.shp']
for EachShp in ShapefileList00:
arcpy.conversion.FeatureClassToFeatureClass(
in_features = EachShp,
out_path = LandCover,
out_name = ShapenameList00
)