AnsweredAssumed Answered

Printing an add_to_selection features' message.

Question asked by B00513467_GIS_Core on May 2, 2020
Latest reply on May 3, 2020 by Dan_Patterson
#Creating features list for Buffer Analysis
fcList = ["schools.shp", "BroomeGroceryStores.shp"]

#Selecting schools that fall within 805 meters of a grocery store
buffList = []
for fc in fcList:
    buff = arcpy.Buffer_analysis("BroomeGroceryStoress.shp", "Results/BroomeGroceryStores_buffer.shp", "805 METERS")
print arcpy.GetMessages()
for buff in buffList:
    arcpy.SelectLayerByLocation_management("schools", "WITHIN", buff, 0, "ADD_TO_SELECTION")
print "Done"

Is there a way to print out how many features are selected under a buffer for analysis purposes using Python? I have the following script where I put an 805-meter buffer around grocery stores, and brought in a shapefile called schools and wanted to know how many schools fall within 805 meters (which is 0.5 miles) of a grocery store? When I run the script it shows me the selection of schools, but I was wondering if there was a way I can make the program print or create table full of values on how many features are selected under the buffering circle. Please let me know. Thank you!