For this script, we will use the CSV module, a useful module to create Comma Separated Value spreadsheets. Its simple syntax will make it a useful tool to create script outputs. It should be noted that ArcGIS for Desktop also installs the xlrd and xlwt modules, used to read or generate Excel spreadsheets respectively, when it is installed.
Just below the import arcPy line, add
import csv. This will allow us to use the csv module to create the spreadsheet:
# Import arcpy module import arcpy import csv
The next adjustment is made to the Intersect tool. Notice that the two paths included in the input string are also defined as variables in the variable section. Remove the file paths from the input strings and replace ...