Snippets

emptypage Genareta password

Created by Masaaki Shibata
#!/usr/bin/env python3.6

import secrets
import string

alphabets = set(string.ascii_letters)
digits = set(string.digits)
punctuations = set(r'#$&+-=.:?@/_^`|()[]')

letters_set = (alphabets | digits | punctuations)
letters_set -= set('10OIl|')
letters = sorted(letters_set)

while True:
    pw = ''.join(secrets.choice(letters) for __ in range(12))
    pwset = set(pw)
    if (not (pwset & alphabets)):
        continue
    if (not (pwset & digits)):
        continue
    if (not (pwset & punctuations)):
        continue
    break

print(pw)

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.