Coding differences between ArcGIS for Desktop and ArcGIS Pro

In this section, we'll discuss some of the differences between Python code written in ArcGIS for Desktop and ArcGIS Pro. Fortunately, there aren't many differences.

ArcPy supports a variety of modules, including the data access, mapping, spatial analyst, network analyst, and time modules. As you have already learned, to use these modules, you must first import them into your script. For most of these modules, the way that you import them will be the same regardless of whether you're using ArcGIS for Desktop or ArcGIS Pro. However, there are some differences when importing the ArcPy mapping module.

In the ArcGIS Pro Python environment, you'll need to use the following syntax to import the mapping module. The use of a two-character reference to the mapping module is in line with how all the other modules are imported:

import arcpy.mp

This differs from how you reference the ArcPy mapping module in ArcGIS for Desktop, as seen in this code example:

import arcpy.mapping
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset