Advertisement
Fsoky

Генератор паролей | Fsoky

Aug 6th, 2020
956
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. import random
  2. import os
  3.  
  4. chars = '+-/*!&$#?=@<>abcdefghijklnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'
  5.  
  6. number = int( input( 'Кол-во паролей: ' ) )
  7. lenght = int( input( 'Длина строки: ' ) )
  8.  
  9. for x in range( number ):
  10.     password = ''
  11.  
  12.     for i in range( lenght ):
  13.         password += random.choice( chars )
  14.  
  15.     print( password )
  16.  
  17.     file = open( 'password.txt', 'a' )
  18.     file.write( '\n' + password )
  19.     file.close()
  20.  
  21. # Закрытие программы при нажатии клавиши в консоли   
  22. os.system( 'pause' )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement