[GIS] Debugging AttributeError: ‘Result’ object has no attribute ‘save’ from ArcPy script

arcgis-10.1arcpyerrorpython-2.7

I Keep getting this error message when i run the code below, can anyone tell me why?

Error message:

Traceback (most recent call last):
  File "C:\Python27\ArcGIS10.2\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 326, in RunScript
    exec codeObject in __main__.__dict__
  File "C:\GEP_662\Final_Project\Final_Project1.py", line 65, in <module>
    result3.save('C:\GEP_662\\Final_Project\\satersym')
AttributeError: 'Result' object has no attribute 'save'

Code:

import arcpy

rasterLayer = "C:\GEP_662\\Final_Project\\TOC_IDW1.lyr"
rasterLayerName = 'TOC_IDW_LYR'

# Apply the symbology from the symbology layer to the input layer
outputraster = arcpy.ApplySymbologyFromLayer_management(rasterLayerName, rasterLayer)
outputraster.save('C:\GEP_662\\Final_Project\\rastersym')

print "symbology update done"

Best Answer

Geoprocessing tools (with the exception of Spatial Analyst tools) return a Result object, which is what arcpy.ApplySymbologyFromLayer_management returns here. It doesn't have a save method. You may be getting this mixed up with a MapDocument or Layer object.