#!/usr/bin/env pythonimport randomimport stringimport syssimilar_char = ' 0ooii1lpp ' upper = '. Join (Set ( String.uppercase)-Set (Similar_char)) lower = ". Join (Set (String.lowercase)-Set (Similar_char)) symbols = '!#$%&\* +,-./:; [Email protected]^_ ' ~ ' numbers = ' 123456789 ' group = (upper, lower, symbols, numbers) def getpass (lenth=8):p w = [Random.choi CE (i) for i in Group]con = ". Join (group) for I in range (Lenth-len (PW)):p w.append (Random.choice (Con)) random.shuffle (PW) Return '. Join (PW) Genpass = getpass (int (sys.argv[1))) Print Genpass
#!/usr/bin/env pythonimport randomimport stringdef genpassword (length): chars=string.ascii_letters+string.digits ret Urn '. Join ([Random.choice (chars) for I in range (length)]) if __name__== "__main__": For I in range: print Gen Password (15)
This article from the "Muzinan Technology Blog" blog, reproduced please contact the author!
Password Generator (python)