Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from sys import argv
- from random import random, choice
- a = 'AEIOUYaeiouy'
- b = 'BCDFGHJKLMNPQRSTVWXYZbcdfghjklmnpqrstvwxyz'
- try:
- l = 10 if len(argv)<2 else int(argv[1])
- except:
- print('Bad length of password!')
- exit()
- print('First way:')
- for i in range(5):
- p = ''
- while len(p)<l:
- p += choice(b)
- if random()>.5:
- p += choice(b)
- p += choice(a)
- print(' '+p[:l])
- orig = 'qwertyuiopasdfghjklzxcvbnm'
- repl = ' 3 7 0 45 9 12 6 '
- words = []
- #p = argv[0][:argv[0].rfind('/')]
- #if p:
- # p += '/'
- p = ''
- with open(p+'words', 'r') as f:
- for i in f:
- words.append(i[:-1])
- print('Second way:')
- for i in range(5):
- t = ''
- while len(t)<l:
- t += choice(words).capitalize()
- for a, b in zip(orig, repl):
- if b!=' ':
- t = t.replace(a, b)
- print(' '+t)
- print('Third way:')
- for i in range(10):
- t = ''
- while len(t)<l:
- t += choice(words).capitalize()
- for a, b in zip(orig, repl):
- if b!=' ' and random()>.5:
- t = t.replace(a, b)
- print(' '+t)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement