for i in range(11):
code_qz = 'DD'
code_sj = datetime.datetime.now().strftime('%Y%m%d%H%M%S')
code_ls = str(i).zfill(4)
print(code_qz + code_sj + code_ls)
效果如下:
标签:M%,code,sj,python,qz,datetime,流水号,ls,YYYYmmddHHMMSS
来源: https://www.cnblogs.com/fell/p/15248661.html