Module 3: Debugging


Module 3: Debugging


Mod 3 Script 1 results:                                                                 







Mod 3 Script 2 results: 










Mod 3 Script 3 results:                                            
















For Script 3, there was an exception error that had to be remedied, using the try-except function. 

The first step that was taken to figure out where the try-except statement was supposed to go, was toggling through the debugger to identify what line of code the exception error was on. The Debugger was able to identify the run-time error was present in the first part of the code. So, the try statement went after importing arcpy, and before the first part of the code. The except statement wen after the last print of part A and before part B. the exception read as follows: 

except Exception as e: 
print(e)

In simpler terms, the try-except function encompasses the part of the code that contains the error (an error sandwich, if you will) and allows the code to run with the exception.
The indentation on the code was incorrect, so it was also necessary to go through and indent the appropriate print statements. 


Other Notes
It was easy to identify syntax errors in the first exercise, however it took quite a bit of time to figure out that one of the main errors I was encountering was related to the file path. The file path was incomplete and the data needed for the script was in a different folder than what was printed. 



Comments

Popular posts from this blog

Module 5: Exploring and Manipulating Data

GIS internship: Post #4