Last active
August 13, 2016 04:41
-
-
Save dumpmycode/14fc52384c0d1e92f9c3 to your computer and use it in GitHub Desktop.
practicepython.org - password generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
# author: oscarp | |
# practicepython.org password generator | |
import random | |
import string | |
def pwgen(pwlen): | |
box = string.ascii_letters + '][?/<~\#`!@$%^&*()+=}|:";\',>{' | |
return (''.join(random.sample(box, pwlen))) | |
an = raw_input('Do you want to generate new password? (y/n)') | |
while an != 'n': | |
n = int(raw_input('enter password length (over 8 characters is recommended): ')) | |
print('Your new password is: "{}"'.format(pwgen(n))) | |
an = raw_input('Do you want to generate new password again? (y/n)') | |
print('Thank you for using our super sophisticated fort knox level password generator okm8.') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment