Advertisement
Guest User

Password Generator

a guest
Jul 7th, 2015
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.24 KB | None | 0 0
  1. from random import SystemRandom
  2. from string import printable
  3.  
  4. def random_char():
  5.     return SystemRandom().choice(printable[:-5])
  6.  
  7. def random_password(length=16):
  8.     chars = [random_char() for _ in range(length)]
  9.     return ''.join(chars)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement