AnsweredAssumed Answered

Python script- changing layer's name

Question asked by MalgosiaMendela on Mar 30, 2016
Latest reply on Mar 31, 2016 by bixb0012

Hello, I do not know why the following python script does not work and cause a change of the layer's name (from 'States' to 'Stany'). After running the script I have received the message:" script returned exit code 0". Any suggestions? Thank you.


import arcpy.mapping

mxd = arcpy.mapping.MapDocument("F:/DSW/Using_ArcGIS_Desktop/MexicoPopulationDensity.mxd")

for df in arcpy.mapping.ListDataFrames(mxd):

    if ( == 'States'):

        layers = arcpy.mapping.ListLayers(mxd,'Stany',df)