如何给新添的字段自动编号

【如何给新添的字段自动编号】我想把图片中的编号用“1,2,3,4……”进行自动编号。如果不用excel表挂接的话还有其他的办法吗?比如字段计算器的vb或者pyhon脚本怎么设置。。。求大伙帮一下
已邀请:

wy

赞同来自:

total = 0 
def acc(increment):  
     global total  
     if total:  
         total += increment  
     else:   
          total = increment  
     return total
     

江宝骅

赞同来自:

如图所示,acc(1)表示由“1”开始自增1
360截图20160904153323672.jpg

出自:http://zhihu.esrichina.com.cn/question/6399

LZ峰wolf

赞同来自:

这是我参考gis里的脚本编的。已经成功了,大家以后用的话可以参考

要回复问题请先登录注册