October 2017
Intermediate to advanced
382 pages
11h 26m
English
Adding print statements to your code to print out values or even just to let you know how far the script progresses during execution is an easy way to help you debug your scripts. However, the downside to this method is that it takes time to add all those print statements, and then most of the time you aren't going to want to leave them in production code, so you'll have to take them out. Then, when an issue comes up, you must put the print statements back in again--essentially, it's a kludgy process.
Continuing with our GetCount() mishap earlier, let's look at a basic script that gets a count of the records in a feature class, and if the record count is greater than zero (there are features in the feature class), export ...