Grinder产生格式化随机数

比如要产生如下格式的数字

位数固定8位,最大不超过10000000,右对齐

使用下面的Grinder代码可以

from java.util import Random
...

num = '{:0>8}.format(Random().nextInt(10000000))
print num

  

原文地址:https://www.cnblogs.com/boucher/p/5577510.html