|
本帖最后由 m2123476wqm2q4v 于 2018-5-9 15:32 编辑
比如有一群建筑 有的是商用有的是民用 等等有跟多类 (用途字段)
然后 一次操作 商用的从0001开始编号 民用的从0001开始编号
哪位大神给个python代码 按 用途字段 来重排编号
我现在有个python的代码是全部重排的
step=0
def autoIncrement():
global step,code
pStart = 1
pInterval = 1
if (step == 0):
step = pStart
else:
step = step + pInterval
code='%05.0f'%step
return code
|
|