yaoz

missing result from a python tool

Discussion created by yaoz on Oct 3, 2012
I am relatively new to ArcPy 10. and I want to return the list of feature class from a  dataset. I can see them through the message, but cannot see them from the result window. Actually there are only inputs, environments and messages I can view from the results window.  Am I missing something in the script? Thanks.
import arcpy
import json
from arcpy import env
env.workspace=r"C:\sde\pan18.sde"
featureDatasets = arcpy.ListDatasets("SDE.POINT_OF_INTEREST")
fd=featureDatasets[0];
fcList=arcpy.ListFeatureClasses("*", "ALL", fd)
pf=[]
for fc in fcList:
   pf.append(fc)
arcpy.AddMessage("--------Encode the list to a json string-\n")
layerlistEncode=json.dumps({'resource':pf})
print layerlistEncode
arcpy.AddMessage("--------Encode the json string to a list\n")
layerlistDecode=json.loads(layerlistEncode)
print layerlistDecode
print layerlistDecode["resource"]
arcpy.SetParameterAsText(0, layerlistEncode)

arcpy.AddMessage(layerlistEncode)
arcpy.AddMessage("finished1")

Outcomes