problem with listfield

Discussion created by QMcCarthy on Jun 22, 2012
Latest reply on Jun 22, 2012 by QMcCarthy
I have a program that need lthe listfield command. I keep getting an invalid syntax when I run the check in pythonwin.

wsWorkSpace = sys.argv[1] ## Workspace.
fcOutCov = sys.argv[2] ## fc That is created.
fcPolyXYSrc = sys.argv[3] ## fc with polygon centroid values.

arcpy.workspace = wsWorkSpace
arcpy.overwriteoutput = 1

    # Assign empty values to cursor and row objects
    iCur, sRow, sCur, feat = None, None, None, None
    #shapeName = arcpy.Describe(inPts).ShapeFieldName

    # Create the output feature class
    #outPath, outFC = os.path.split(outLine)
    arcpy.CreateFeatureclass_management((arcpy.workspace, fcOutCov, "POLYLINE -", "", "", "", fcPolyXYSrc, "", "", "", "")
    FieldList = arcpy.ListFields(fcPolyXYSrc)
    for field in FieldList:
        print field.name
I have tried to cut and paste these commands into pythom command window and it work fine.

Also when I take out the variable references and hard code the feature class path I get the same error.

I just about copied it it from the list field help.

Not sure what I missed.