Module 3 - Debugging and Error Handling

    This week's module taught us how to debug Python runtime errors. We were given three scripts, all of which had exceptions, and were made to fix them. We had to use a try-except statement to fix the third script. I had to change some of the file paths in the script as they did not align with my file structure. Some of the file paths also referenced the wrong aprx.
     
   
     For step two of the third script, I first ran the script to identify where the error was. I then inserted the try statement above the line where the error was, indented all of part A to be within the try statement, and added the except statement below part A. The try-except statement would now print out the exception message, which would prevent the compiler from returning a runtime error for part A of the script.
 

No comments:

Post a Comment