I want to perform a loop of intersections between different files in different directories. Here is my code:
Intersects = ['Name1','Name2','Name3','Name4','Name5'] #Names of my files
arcpy.env.workspace = "C:\Mydirectory" #Directory of the files above
lands = "C:\Anotherdirectory\Shapefile_To_Intersect.shp" #Name of the second shapefile to intersect, in another directory
# Where I want my output to be placed, this folder is already created and empty
out = "C:\Users\Laptop\Documents\ArcGIS\Default.gdb\Intersects"
for files in Intersects:
Intersects_Names = ['Name1','Name2','Name3','Name4','Name5']
arcpy.Intersect_analysis([files, lands], os.path.join(out,files))
But this way I get the error:
ERROR 000732: Input Features: Dataset Name1 #;C:\Anotherdirectory\Shapefile_to_Intersect.shp # does not exist or is not supported.
What is the issue in this case? (I checked the file name and directory are correct).