Displaying outputs in ArcMAP through an encapsulated Python script!!

Discussion created by carme.caum on Jan 31, 2012
Hi everybody,

I'm trying to pack to following Python code in an script from a toolbox. I want to display a graph (Survival.png) as a new layer but I have not been capable of printing out anything :(

The code works when I execute it throught the Python prompt in ArcMap: it creates a new layer that I can visualize. Great! But, once I put the same code encapsulated in a script (in a new toolbox) it seems to be completed succesfully (no message error) but I get nothing.

import arcpy
from arcpy import env
if __name__ == '__main__':
        arcpy.env.pyramid = "PYRAMIDS 3 BILINEAR JPEG"

Any ideas?
I suspect that there are some instructions missed in the script code in order to visualize all the outputs.

I am not an expert on ArcGIS or Python so...any help would be really appreciated!

Carme Caum