HOW TO
The instructions below describe the steps to use Python code to list the data source for each layer in an MXD’s table of contents.
![[O-Image]](https://webapps-cdn.esri.com/CDN/support-site/technical-articles-images/000011530/00N39000003LL2C-0EM39000000wdLO.png)
import arcpy
mxd = arcpy.mapping.MapDocument("CURRENT")
for lyr in arcpy.mapping.ListLayers(mxd):
if lyr.supports("DATASOURCE"):
print "Layer: " + lyr.name + " Source: " + lyr.dataSource
Example:![[O-Image]](https://webapps-cdn.esri.com/CDN/support-site/technical-articles-images/000011530/00N39000003LL2C-0EM39000000wdLN.png)
![[O-Image]](https://webapps-cdn.esri.com/CDN/support-site/technical-articles-images/000011530/00N39000003LL2C-0EM39000000wdLQ.png)
Article ID: 000011530
Get help from ArcGIS experts
Start chatting now