Book Image

ArcPy and ArcGIS: Geospatial Analysis with Python

Book Image

ArcPy and ArcGIS: Geospatial Analysis with Python

Overview of this book

Table of Contents (19 chapters)
ArcPy and ArcGIS – Geospatial Analysis with Python
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Running the script in the Python Window


Open up the map document called MapAdjust.mxd if it is not open already. Open the Python Window and right click in the window. Select Load from the menu. When the file dialog opens, find the script called Chapter8_6_AdjustmapCURRENT.py and select it, making sure that the file paths within it are correct. Push OK and it will load in the Python Window. Push Enter once the script is loaded to run the script. It can take a few seconds or more for it to be obvious that the script is running.

Note

Note that the Python Window is not a great place to execute ArcPy scripts in most cases, as it is somewhat limited when compared to IDEs. Using it to load and execute a script that performs these map document adjustments is one of the best uses of the Python Window.

Once the script is running, the adjustments to the map document will begin to appear and repeat. This is a fascinating process, as the effects of running the script are visible in a manner that is not...