Menu

Specify Editor for Python Scripts in ArcGIS for Desktop

Python, it is extremely useful for streamlining workflows and SOP for a multitude of tasks. This is particularly true for geoprocessing in ArcGIS. True, ModelBuilder can be used. More often than not, I find myself starting in ModelBuilder and finishing in Python simply because of the ability to have more control over processes and the ease of using iteration.

ArcGIS for Desktop 10 introduced the option to embed scripts into tools. Once embedded, editing is as simple as right clicking on the script in a toolbox and selecting edit. The default Python IDE, IDLE would open and from there the script could be edited.

After installing ArcGIS for Desktop 10.1 Prerelease, I discovered when choosing to edit an embedded script, the script opened in Notepad. This was not acceptable. Fortunately setting the editor is an easy change.

To set the Python editor, from the Geoprocessing menu select Geoprocessing Options. In the Geoprocessing Options dialog, browse to the path where the desired editor executable file is located for Script Tool Editor/Debugger. For the Wing editor on my machine, the path is C:Program Files (x86)Wing IDE 101 4.1binwing-101.exe.

If you do not know the path to your Python editor, you can get it from the Windows Start Menu. The Start menu is nothing more than a collection of shortcuts to programs. You can get the location these shortcuts reference from the shortcut properties.

To find these paths, open the Start menu and right click on the program you prefer to use for script editing. Select properties and in the dialog select the Shortcut tab. In the shortcut tab, simply copy the target field. Use this path in ArcGIS as the location of both your script editor and debugger. With these properties set in ArcGIS for Desktop, you can seamlessly use any IDE you like for editing your scripts.