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 (df.name == 'States'):
layers = arcpy.mapping.ListLayers(mxd,'Stany',df)