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

How to assign variables to values inside fields.

$
0
0
Hello,

I want to assign variables to values inside fields.

There is one example of a script that retrieve values from a field and print them in the console. I need something like that but for get this values in different variables.

Thank you

Code:

import arcgisscripting
i = arcgisscripting.create(10.1)

rows= i.searchcursor("C:/test/testline.shp","","","FID,Id","")
row = rows.next()
currentstate = ""
while row:
    if currentstate != row.FID:
        currentstate = row.FID

        print (row.Id,row.FID)
    row = rows.next()


Viewing all articles
Browse latest Browse all 2485

Trending Articles