Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

Trying to create a list of strings from rows

$
0
0
I'm trying to create a list of strings from the rows in a table, but I'm only getting the first letter of each string and not the string.

Code:

import arcpy

arcpy.env.workspace = "C:/Data_new/Temp/Default.gdb"

cursor = arcpy.SearchCursor("parcels_sel")

for row in cursor:
    testVal = row.getValue("Name1")
    print testVal[0]

del testVal   
del row

this returns the first letter of each name(L, K, P, etc). How do I get a list of the names(Leonard, Koontz, Perrell, etc)?

Viewing all articles
Browse latest Browse all 2485

Trending Articles