Created
October 5, 2011 16:27
-
-
Save 0xPr0xy/1264918 to your computer and use it in GitHub Desktop.
password generator
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
from string import digits, ascii_letters | |
from random import choice | |
from sys import argv | |
def generator(length): | |
chac = digits + ascii_letters | |
pwd = list() | |
for p in range(length): | |
pwd.append(choice(chac)) | |
print("".join(pwd)) | |
def main(): | |
try: | |
args = argv[1] #Terminal argument | |
#Run!! And don't forget to add the password lenght | |
generator(int(args)) | |
except IndexError: | |
generator(12) | |
if __name__ == '__main__' : main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment