Python password generator #!/usr/bin/env python # Filename: passgen.py import random, string mystr = string.ascii_letters+string.digits random_string = [] while len(random_string) <= 8: random_string.append(random.choice(mystr)) print "".join(random_string)