Skip to content

Instantly share code, notes, and snippets.

@iswarup
Created June 21, 2018 09:53
Show Gist options
  • Save iswarup/5562e0c5edfc77b78af6fab2d0b677ca to your computer and use it in GitHub Desktop.
Save iswarup/5562e0c5edfc77b78af6fab2d0b677ca to your computer and use it in GitHub Desktop.
Password Generators
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