def randomStr(length=4, lowercase=False, alphabet=None, seed=None):
 if (seed is not None):
  _ = getCurrentThreadData().random
  _.seed(seed)
  choice = _.choice
 else:
  choice = random.choice
 if alphabet:
  retVal = ''.join((choice(alphabet) for _ in xrange(0, length)))
 elif lowercase:
  retVal = ''.join((choice(string.ascii_lowercase) for _ in xrange(0, length)))
 else:
  retVal = ''.join((choice(string.ascii_letters) for _ in xrange(0, length)))
 return retVal

def randomStr ( length = 4 , lowercase = False , alphabet = None , seed = None ) : if ( seed is not None ) : _ = getCurrentThreadData ( ) . random _ . seed ( seed ) choice = _ . choice else : choice = random . choice if alphabet : retVal = '' . join ( ( choice ( alphabet ) for _ in xrange ( 0 , length ) ) ) elif lowercase : retVal = '' . join ( ( choice ( string . ascii_lowercase ) for _ in xrange ( 0 , length ) ) ) else : retVal = '' . join ( ( choice ( string . ascii_letters ) for _ in xrange ( 0 , length ) ) ) return retVal
returns random string value with provided number of characters .