Essential Python vocabulary

This document introduces some vocabulary that is essential to understanding the Geoprocessing with Python help.

Term

Description

Python

Python is an open-source programming language that was conceived in the late 1980s by Guido van Rossum, and introduced in 1991. It was first incorporated with ArcGIS 9.0 and has since become the preferred choice for users creating geoprocessing workflows.

Python is supported by a growing and varied user community and provides easy readability, clean syntax, dynamic typing, and an extensive collection of standard and third-party libraries.

PythonWin

PythonWin is a widely used third-party Windows interface for Python and is available for installation on the ArcGIS installation media.

ArcPy

ArcGIS 10 introduces ArcPy (often referred to as the ArcPy site-package), which provides Python access for all geoprocessing tools, including extensions, as well as a wide variety of useful functions and classes for working with and interrogating GIS data. A site-package is Python's term for a library that adds additional functions to Python. Using Python and ArcPy, you can develop an infinite number of useful programs that operate on geographic data.

ArcPy modules

A module is a python file that generally includes functions and classes. ArcPy is supported by a series of modules, including a mapping module (arcpy.mapping), a Spatial Analyst module (arcpy.sa), and a Geostatistical Analyst module (arcpy.ga).

ArcPy classes

A class is analogous to an architectural blueprint. The blueprint provides the framework for how to create something. Classes can be used to create objects, often referred to as an instance. ArcPy classes, such as the SpatialReference and Extent classes, are often used as shortcuts to complete geoprocessing tool parameters that would otherwise have a more complicated string equivalent.

ArcPy functions

A function is a defined bit of functionality that does a specific task and can be incorporated into a larger program.

In ArcPy all geoprocessing tools are provided as functions, but not all functions are geoprocessing tools. In addition to tools, ArcPy provides a number of functions to better support geoprocessing Python workflows. Functions or methods can be used to list certain datasets, retrieve a dataset's properties, validate a table name before adding it to a geodatabase, or perform many other useful scripting tasks.

Stand-alone Python script

A Python script is a .py file that can be executed. A stand-alone Python script is a .py file that can be executed from the operating system prompt or a development application like PythonWin or by double-clicking the .py in a Windows Explorer.

Python script tool

A Python script tool is a Python script that has been added to a geoprocessing toolbox. Once added as a script tool, the script tool becomes like any other geoprocessing tool—it can be opened and executed from the tool dialog box, used in the Python window and ModelBuilder, and called from other scripts and script tools.

Python window

ArcGIS 10 introduces a new embedded Python experience. The geoprocessing command line from past releases has been re-invented as a fully interactive Python window. This is a quick and convenient place to use Python from within ArcGIS to interactively run geoprocessing tools and functionality as well as take advantage of other Python modules and libraries. This window also provides a gateway for users to learn Python.

The Python window can be used to execute a single line of Python code, with the resulting messages printed to the window. It is a useful place to experiment with syntax and work with short lengths of code and provides an opportunity to test your ideas outside a larger script.

Related Topics


12/15/2011