Advertisement
Guest User

.

a guest
Nov 10th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. import random
  2.  
  3. import os
  4.  
  5.  
  6. def addToClipBoard(text):
  7. command = 'echo ' + text.strip() + '| clip'
  8. os.system(command)
  9.  
  10.  
  11. def PasswordGenerator():
  12. password = []
  13. caps = ["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"]
  14. lows = ["a", "b", "c", "d", "e", "f", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
  15. numbers = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"]
  16. symbols = ["!", "@", "#", "$", "%", "&", "^", "*"]
  17. while len(password) < 15:
  18. password.append(random.choice(caps))
  19. password.append(random.choice(lows))
  20. password.append(random.choice(numbers))
  21. password.append(random.choice(symbols))
  22. else:
  23. password = ''.join(password)
  24. print password
  25. addToClipBoard(password)
  26. user = raw_input("Do you want to generate another password Y / N:")
  27. if user == "y" or "Y" or "yes":
  28. PasswordGenerator()
  29.  
  30.  
  31. PasswordGenerator()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement