Skip to content

Instantly share code, notes, and snippets.

@flashingpumpkin
Created December 5, 2011 12:10
Show Gist options
  • Select an option

  • Save flashingpumpkin/1433394 to your computer and use it in GitHub Desktop.

Select an option

Save flashingpumpkin/1433394 to your computer and use it in GitHub Desktop.
randompw.py
#!/usr/bin/env python
import random
import string
def random_pw():
char_set = list(string.letters + string.letters.upper() + string.digits + string.punctuation)
return ''.join(random.sample(char_set, 20))
if __name__ == "__main__":
print random_pw()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment