def randomInt(length=4, seed=None):
 if (seed is not None):
  _ = getCurrentThreadData().random
  _.seed(seed)
  choice = _.choice
 else:
  choice = random.choice
 return int(''.join((choice((string.digits if (_ != 0) else string.digits.replace('0', ''))) for _ in xrange(0, length))))

def randomInt ( length = 4 , seed = None ) : if ( seed is not None ) : _ = getCurrentThreadData ( ) . random _ . seed ( seed ) choice = _ . choice else : choice = random . choice return int ( '' . join ( ( choice ( ( string . digits if ( _ != 0 ) else string . digits . replace ( '0' , '' ) ) ) for _ in xrange ( 0 , length ) ) ) )
returns random integer value with provided number of digits .