Modify the Python Script from the Gold Model
____ 20. Modify the Python Script: In the text of the script you will find comments consisting of dashed lines. After the second set of such lines type the command
print “Beginning execution of Gold_Model script”
This command causes the text within quotation marks to appear on the screen when the program begins execution—just to reassure you that something is happening. (This script can take two or three minutes to run; all you will see is a blank screen unless you mark the beginning in some way.) You might also put a similar print command at the end of the program.
____ 21. The more important modification is to tell Python to overwrite existing files. You will find a command early in the script that says “import arcpy”, which brings the ArcGIS version of Python into play. On the next line after this, you should enter, exactly as shown:
arcpy.env.overwriteOutput = True
Save the Python script (Ctrl+S). Close ArcCatalog and ArcMap if either is or both are open.

Get Introducing Geographic Information Systems with ArcGIS: A Workbook Approach to Learning GIS, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.