Created
June 21, 2018 09:53
-
-
Save iswarup/5562e0c5edfc77b78af6fab2d0b677ca to your computer and use it in GitHub Desktop.
Password Generators
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
import random | |
s = "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()_<>?+:" | |
passlen = 8 | |
p = "".join(random.sample(s,passlen)) | |
m = random.sample(s,passlen) | |
print (p,m) | |
import string | |
def pw_gen(size=8, chars=string.ascii_letters + string.digits + string.punctuation): | |
return ''.join(random.choice(chars) for _ in range(size)) | |
print(pw_gen) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment