Module 2: Debugging and Error Handling

 This week we learned about the types of errors in scripting and how we can utilize the debugging tool in Spyder to fix those errors. Additionally, we learned about try-except statements that allow us to run a script with exceptions. 

The first thing to note about errors in a script is the color separation that identifies errors in the console. Red is commonly used to identify errors. An example of what is identified as an error is a syntax error with a ^ position symbol ( this doesn't mean it is where the location of the error). 

Script 1 

To get the results for this script, we had to fix the FC that was misspelled. I also had to update the file path and recognizing the correct function was used and entered correctly. 




Script 2
For the second script, we were tasked to correct the script's errors. By making changes into the file path to update and correct any spelling of the files. Additionally, correct small details of assigned features and were carried over in the script. 

Script 3 
Finally, in the third script, we learned to apply the try-except statement. This application allows you to make edits to the script while the script is running. This is done when edits to the script are done during the run we are making changes to the original script, but not to the runner script so therefore it doesn't affect the running script. 
I found it useful for the 3rd script because there were many lines that needed to be analyzed to check for errors. With scripts that are very short, it would be not as effective.





Flowchart




Comments

Popular posts from this blog

Module 3: Cartographic Design

Fundamentals in Python

Module 5: Choropleth and Proportional Mapping