Python
ArcGIS Pro
Python 2.7 vs. 3.4
Python for ArcGIS Pro
Mapping Module
www.codecademy.com/learn/python
Combines the best parts of ArcMap, ArcCatalog, and ArcGlobe
print "Hello Sam"
print("Hello Sam")
3 / 2 = 1
3 / 2 = 1.5
# Create map document object
mxd = arcpy.mapping.MapDocument("CURRENT")
# Create data frame object
df = arcpy.mappingLisDataFrames(mxd)[0]
# Create list of layers in data frame
lyr_list = arcpy.mapping.ListLayers(mxd,"",df)
# Iterate through list and print layer names
for lyr in lyr_list:
print lyr.name
# Create ArcGIS Project object
aprx = arcpy.mp.ArcGISProject("CURRENT")
# Create map object
m = aprx.ListMaps()[0]
# Create list of layers in map
lyr_list = m.ListLayers()
# Iterate through list and print layer names
for lyr in lyr_list:
print(lyr.name)
pro.arcgis.com/en/pro-app/arcpy/get-started/installing-python-for-arcgis-pro.htm
www.accounts.esri.com
py -3 python3script.py
python python2script.py
samg@northpointgis.com
218.720.67.47 ext 4