def make_random(nchars): alphabet = string.ascii_letters + string.digits return ''.join(random.choice(alphabet) for _ in range(nchars))