# Import COM Dispatch and create geoprocessor
import win32com.client 
GP = win32com.client.Dispatch("esriGeoprocessing.GpDispatch.1")

# Create search cursor
rows = GP.SearchCursor("C:\\gene\\gis\\mars\\layers\\MARSRouteE-3d.shp")
row = rows.Next()

fields = GP.ListFields("C:\\gene\\gis\\mars\\layers\\MARSRouteE-3d.shp")
fields = fields.Next()

while field:
    print field.name + ": Value = " + str(row.GetValue(field.name))
    field = field.Next()
    
# Create the geometry object
##feat = row.shape
##
##a = 0
##while a < feat.PartCount:
##    # Get each part of the geometry
##    roadArray = feat.GetPart(a)
##    roadArray.Reset
##    # Get the first point object for the feature
##    pnt = roadArray.Next()
##    print " "
##    while pnt:
##        print str(pnt.id) + "; " + str(pnt.x) + "; " + str(pnt.y)
##        pnt = roadArray.Next()
##        a = a + 1
##        row = rows.Next()
##    
