For this module, we were tasked with learning and understanding how to implement tools to debug and fix any errors within the script. We also learned about ways to not necessarily fix the errors within the script but to show what errors could be present and then use a statement to highlight if there is an error. This module also introduced the IPython Debugger, which allowed me to analyze each row for errors as well as alert me to any errors present in each row.
The first part was focused on identifying and fixing two errors present within the script. I used the debugger tool and went through each row until I found the two errors which were just some misspellings and capitalization errors. Once those were fixed, the script ran successfully producing all of the names of the fields within the attribute table. (See Image 1)
Image 1:
For the second part of this lab, we were fixing and identifying errors. These were similar to the last part but with more errors. There were some misspelled words but there was an error in my file path that held the data being used. This was one of the reasons for my script not running and having an error because the file path needed was incomplete. I had some struggles with one of the errors because it was not identified correctly but after some concentration and looking over the entirety of the script I found there was an incomplete word that needed to be connected with another row for the data to match and the layer names could be showcased after running. These small errors took some time to figure out and to adjust to allow for the correct script to run but once I did it, I had the following results: (See Image 2)
Image 2:
For the last part of the lab, we were implementing a try-except statement to allow for a script to run successfully with the errors still present. This was a bit of a challenge for me because I could not quite understand how it worked or how it should be implemented for each error. After some honest toying around and trying out different areas, allowed me to see what statement would work best. I was able to be successful and get the desired end result but I feel I could gain more experience on the try-except statements. (See Image 3)
Image 3:
Comments
Post a Comment