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

Populate a field with Python in the field calculator using a list.

$
0
0
Dear all,

I would like to create a modification of this code:

rec=0
def autoIncrement():
global rec
pStart = 1
pInterval = 1
if (rec == 0):
rec = pStart
else:
rec += pInterval
return rec

Because I need to populate the elements= 0 with the numbers of a list. Could you help me?

Thank you in advance for your collaboration.

Regards

Viewing all articles
Browse latest Browse all 2485

Trending Articles