Python ArcGIS 9.3 vs ArcGIS 10.0#
ArcGIS 9.3 and 10.0 have different ways to access Geoprocessing Tools through Python. Generally a script needs to:
Import the ArcGIS module
Create the geoprocessor object
Check the licenses
Comparison between versions#
Feature |
ArcGIS 9.3 |
ArcGIS 10.0+ |
|---|---|---|
Import module |
|
|
Create geoprocessor |
|
Not needed — |
Check out extensions |
|
|
Load toolboxes |
Required manually |
No longer necessary |
Overwrite output |
|
|
Set workspace |
|
|
Note
Modern ArcGIS (10.x and ArcGIS Pro) uses import arcpy directly. The old arcgisscripting.create() pattern is obsolete and should not be used in new scripts.
Migrating from 9.3 to 10.0+#
The tool names are the same for both versions — only the imported module changes from gp to arcpy.
A quick trick to update old scripts (rather than doing a find/replace of all references) is to change the module name:
import arcpy as gp
To update a script from 9.3 to 10.0+:
Replace
import arcgisscriptingwithimport arcpyRemove the geoprocessor object creation line
Remove ToolBox loading statements
Replace
gp.witharcpy.(or use the alias trick above)