From the course: Learning ArcGIS Python Scripting (2018)

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Making scripts dynamic

Making scripts dynamic - ArcGIS Tutorial

From the course: Learning ArcGIS Python Scripting (2018)

Start my 1-month free trial

Making scripts dynamic

- [Instructor] When Python scripts are written to run in ArcGIS, those scripts are usually not designed to work on the same data set every time they run. They're flexible enough to run on different data sets and with different inputs. We do this by allowing command-line arguments, also called parameters, to be passed into the script when it's run. Some examples of why command-line arguments might be used include, allow your script to work on whatever map document the user wants. You could capture the map document name at runtime. Let the user specify the output coordinate system. You could capture the output coordinate system at runtime. ArcMap Tools already work that way. Over here in ArcMap, if we look at Toolbox, and I run a tool, like possibly just the buffer tool, all the options that are needed to run the buffer tool can be specified each time I run it, it's a very flexible tool. When you write a Python script, there is a way to allow these input parameters as well. And if your…

Contents