I am trying to add description to layer and then make a layer package of multiple files at once. Everything works just fine, but the formatting of description is just wrong.
I want to add new lines after each line. What i tried is adding \n, \r \n, '\n', '\r \n', \u000d,
None of these are working.I simply ran out of ideas. In help there is nothing about the formatting.
files = arcpy.ListRasters() name = "Hazard Index" description = "Hazard Index \ \ Ranges of depths for different level of hazard \ \ Depth (d)\ \ not flooded No Hazard 0" for file in files: raster_layer = arcpy.MakeRasterLayer_management (file, file[:-4]) #raster_layer.name = file[:-4] arcpy.ApplySymbologyFromLayer_management(raster_layer, layer) lyr = arcpy.SaveToLayerFile_management (raster_layer, output + file[:-4] + ".lyr") raster_lyr = arcpy.mapping.Layer(str(lyr)) raster_lyr.description = description raster_lyr.name = file[:-4] arcpy.PackageLayer_management(raster_lyr, output + file[:-4], "PRESERVE", "", "", "", "", "", "", summary, tags) print "Package created for: " + file os.remove(str(lyr))
result is (I did not copy all of the text here, but you get the idea)