Created
May 30, 2016 07:22
-
-
Save is/edf7d117b46bed60edc1c55e22a2a134 to your computer and use it in GitHub Desktop.
genpass
This file contains hidden or 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/python | |
| import random | |
| import sys | |
| s = 'abcdefghijklmnopqrstuvwxyz' | |
| s += s.upper() | |
| s += '0123456789' | |
| random.seed() | |
| length = 12 | |
| if len(sys.argv) >= 2: | |
| length = int(sys.argv[1]) | |
| pwd = [s[random.randint(0, len(s) - 1)] for x in range(length)] | |
| print ''.join(pwd) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment