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

name a list with a record in a cursor...

$
0
0
I want to step through some data in a search cursor and create a new list with a name based off one of the attributes.
The code below will return SyntaxError: can't assign to function call. Any ideas how to do this?

Code:

infc = mydata
cursor = arcpy.SearchCursor(infc)
    for row in cursor:
        row.getValue("Name") = []

Same thing happens when I try to convert the result to a string.
Code:

infc = mydata
cursor = arcpy.SearchCursor(infc)
    for row in cursor:
        str(row.getValue("Name")) = []


Viewing all articles
Browse latest Browse all 2485

Trending Articles