Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- import os
- def addToClipBoard(text):
- command = 'echo ' + text.strip() + '| clip'
- os.system(command)
- def PasswordGenerator():
- password = []
- 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"]
- 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"]
- numbers = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"]
- symbols = ["!", "@", "#", "$", "%", "&", "^", "*"]
- while len(password) < 15:
- password.append(random.choice(caps))
- password.append(random.choice(lows))
- password.append(random.choice(numbers))
- password.append(random.choice(symbols))
- else:
- password = ''.join(password)
- print password
- addToClipBoard(password)
- user = raw_input("Do you want to generate another password Y / N:")
- if user == "y" or "Y" or "yes":
- PasswordGenerator()
- PasswordGenerator()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement