I'm creating a table and then trying to delete that table inside the same
for loop as follows:
for fc in fcList: arcpy.GenerateNearTable_analysis(inFile, fc, out_table) arcpy.JoinField_management(inFile, "Obj_ID", out_table, "In_FID", ["NEAR_DIST"]) arcpy.Delete_management(out_table)
But for some reason the delete statement isn't working. The table still exists after the script completes 'successfully'. When I just run the delete statement alone afterwards (means outside the
for loop), then the table is deleted. But I need to delete it inside the
for loop so that I can loop further. I have to put some more statements within the
for loop later and the table needs to be deleted first for the upcoming statements to work.
Delete_management statement not work within a
for loop for any reason?