Created
April 16, 2019 09:49
-
-
Save timkofu/a0178f5ec9c6b7829612f404deb3dc03 to your computer and use it in GitHub Desktop.
Random 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
#!/usr/bin/env python | |
import random | |
import string | |
def generate_random_password(): | |
""" Generate 21 character random password """ | |
selection = string.ascii_letters + string.digits + "#$%&@" | |
rand_pass = "" | |
password_length = 21 | |
while password_length > 0: | |
rand_pass += random.choice(selection) | |
password_length -= 1 | |
return rand_pass | |
if __name__ == "__main__": | |
print(generate_random_password()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment