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 ...

Get ArcPy and ArcGIS – Geospatial Analysis with Python 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.