My Approach to Geoprocessing with Python

I've done a bit of programming with ArcObjects in VB and VBA. I probably hadn't heard of Python until ArcGIS 9.0 came out. I've been interested in learning Python but never followed up on it because I can usually write it quicker in VBA (because I already know how to do it). I've been learning Perl over the past few months too so I understand how scripting languages can be very streamlined and effective for text manipulation and apparently for geoprocessing too. I recently watched a 60 minute tutorial on Scripting called “Getting Started with Scripting in ArcGIS 9”. Its worth watching to get an idea of how the syntax works but the take home is that its really quite easy and intuitive (they don't go into much detail). I think you'd still want a good reference book on hand to help you get started.

In the ESRI tutorial, they mention that there are a lot of tools in ArcToolbox that are written in Python. If you look at the percentage its really not that many, but there is good news. I've found that you can still access the tools that aren't written in python by referencing objects. Here is the real clue. You can export models that you build with Model Builder to python scripts. This is a great way to see the syntax in action. The export process builds all the necessary variables (and some apparently unnecessary ones too) and sets up the geoprocessing objects and the procedures (projects). This has been a great way for me to see the syntax and to build my batch processing scripts using a text editor like vim or plain old notepad. If you are interested, I recommend giving it a shot.