Appendix A. Automating Python Scripts

In this chapter, we will cover the following topics:

  • Running Python scripts from the command line
  • Using sys.argv[ ] to capture command-line input
  • Adding Python scripts to batch files
  • Scheduling batch files to run at prescribed times

Introduction

Python geoprocessing scripts can be executed either outside ArcGIS as standalone scripts or inside ArcGIS as script tools. Both methods have their advantages and disadvantages. Up to this point in the book, all our scripts have been run either inside ArcGIS as a script tool, from a Python development environment such as IDLE, or the Python window in ArcGIS. However, Python scripts can also be executed from the Windows operating system command line. The command line is a ...

Get Programming ArcGIS with Python Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.