GIS5103 - Module 3 - Debugging and Error Handling

             For this week's module 3, we learned how to debug and handle errors when running scripts. 3 scripts were provided for us to fix. This module reinforce the ideas of running making small changes one line at a time for me. Indentation of codes were also important in script #3. Capitalization also matters a lot when writing into code, as not having the same capitalizations for variables could mean your script will not run. 

            

            For script 1, I initially had problem with running it in IDLE. I still do not know why it didn't run in IDLE so I tried my script in ArcGIS and it worked perfectly. There was capitalization errors and variables name were not matching up. I suspect the error is due to me not booting up arcGIS beforehand to login with our UWF Account so the licensing error doesn't appear.


            For script 2, I had to rename the file path to match the .aprx that was provided to us. There was a lot of capitalization errors as variables doesn't match with each other. Some line was even missing a letter. A lot of this errors didn't require me to google as the IDLE suggested a lot of the spelling error correction. 


        For scripts 3 and, 2 I added, a “try:” statement at the very top of the script after the first print function. Then I had to indent a lot of the lines after to make the script work. I kept indenting each line of the code and running it each time until the IDLE successfully ran. I added the “except Exception as e:” after a lot of trials and error but I found it adding it at the very end of the script worked for me. I then used a print function to print out the error. 

            




Comments

Popular posts from this blog

GIS5007 - Orientation - About me

Final Project - GIS5050 - Bobwhite-Manatee Transmission Line Project

GIS5007 - Module 4 - Data Classification