kwilli74

New to Python help!!!

Discussion created by kwilli74 on Sep 30, 2013
Latest reply on Oct 4, 2013 by Wayne_Whitley
I know this is overly simplistic for most on this forum, but I am having difficulty getting this to work.

I need to use Python to find the data type in a .shp. I've created a small script to list the fields, but cannot get it to list the data type from that. Any and all help is greatly appreciated. What I have so far:

import arcpy, sys
input = sys.argv[1]
fields = [f.name for f in arcpy.ListFields(input)]
for field in fields:
    fields.index


My question is how do I get the data type of the fields? I know I have to reference the .name, which is what I'm stuck on.

Outcomes