The second week of Programming is centered around debugging pre-scripted files and learning how to not only properly identify errors in the script but, to also fix them. Below, are 3 separate scripts which we were tasked with having to correct.
The next code as displayed above was a similar situation to the first one. It had numerous small errors in the code to identify and fix. The end result is the code printing out the Spatial Reference for the project code. As well as a list of all of the layer contained in the map for the project.
The 3rd script as displayed above was a completely different setup than the first two scripts. While in this one there was a error code as well. The difference was in this code we had to make the code keep the error code but, still run too. As well as print out the error code which was appearing. This was by far the more complicated one to figure out. But through an actual simple couple commands and an added print function the code ran fine while also stating the error as viewed in part a.
The second week was a very informative one as the these errors persisted in the first week. This one was a good follow up assignment. If definitely prepared you for the future as errors were a definite thing to happen in python as any fluctuation in the code (improper indents, spaces, capitalization, etc) can completely throw the code off and give you error codes. So, being able to troubleshoot these problems is an absolute must!
No comments:
Post a Comment