def generate_random_id ( size = 6 , chars = string . ascii_uppercase + string . digits ) : return "" . join ( random . choice ( chars ) for x in range ( size ) )
python generate guid string
Generate random id numbers .
def generate_random_id(size=6, chars=string.ascii_uppercase + string.digits):
    """Generate random id numbers."""
    return "".join(random.choice(chars) for x in range(size))