def randstr(length, alphabet='abcdefghijklmnopqrstuvwxyz0123456789'):
 return ''.join((random.choice(alphabet) for _ in xrange(length)))

def randstr ( length , alphabet = 'abcdefghijklmnopqrstuvwxyz0123456789' ) : return '' . join ( ( random . choice ( alphabet ) for _ in xrange ( length ) ) )
return a string made up of random chars from alphabet .