add alias; fix structure,copy
This commit is contained in:
parent
3348ccf81e
commit
a2b7cfe401
@ -6,24 +6,6 @@ lettersB=['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
|
||||
lettersS=["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r","s", "t", "u", "v", "w", "x", "y", "z"]
|
||||
special=[ "!", "@", "№", "#", "$", "%", "^", "|", "&", "*", "_", "-", "=", "+", "-", "/", "(", ")", "?", "{", "}", "[", "]", "~", ">", "<", "." ]
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
lineal=int(input("Длина пароля: "))
|
||||
number=input("Использовать числа? [Д/н] ")
|
||||
letterB=input("Использовать большие буквы? [Д/н] ")
|
||||
letterS=input("Использовать маленькие буквы? [Д/н] ")
|
||||
spec=input("Использовать спец символы? [Д/н] ")
|
||||
variables=[number,letterB,letterS,spec]
|
||||
for i in range(len(variables)):
|
||||
if variables[i] =="Д":
|
||||
variables[i]=True
|
||||
if variables[i] =="н":
|
||||
variables[i]=False
|
||||
number,letterB,letterS,spec=variables[0],variables[1],variables[2],variables[3]
|
||||
|
||||
|
||||
|
||||
def alph_generate(number,letterB,letterS,spec):
|
||||
password_lst=[] # Создаём алфавит пароля
|
||||
if number==True:
|
||||
@ -48,11 +30,25 @@ def pass_copy(copys,password):
|
||||
copy(password)
|
||||
|
||||
if __name__ == "__main__":
|
||||
soglasie=["yes","y","д","да"]
|
||||
nigative=["no","n","н","нет"]
|
||||
lineal=int(input("Длина пароля: "))
|
||||
number=input("Использовать числа? [Д/н] ")
|
||||
letterB=input("Использовать большие буквы? [Д/н] ")
|
||||
letterS=input("Использовать маленькие буквы? [Д/н] ")
|
||||
spec=input("Использовать спец символы? [Д/н] ")
|
||||
variables=[number.lower(),letterB.lower(),letterS.lower(),spec.lower()]
|
||||
for i in range(len(variables)):
|
||||
if variables[i] in soglasie:
|
||||
variables[i]=True
|
||||
if variables[i] in nigative:
|
||||
variables[i]=False
|
||||
number,letterB,letterS,spec=variables[0],variables[1],variables[2],variables[3]
|
||||
password_lst=alph_generate(number,letterB,letterS,spec)
|
||||
password=pass_generate(password_lst,lineal)
|
||||
print(password)
|
||||
if(input("Скопировать в буфер обмена? [Д/н] ")=="Д") :
|
||||
if(input("Скопировать в буфер обмена? [Д/н] ").lower() in soglasie) :
|
||||
copys=True
|
||||
else:
|
||||
copys=False
|
||||
pass_copy(copys)
|
||||
pass_copy(copys,password)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user