Created
March 9, 2016 14:15
-
-
Save juanmhidalgo/c4132bedb25397c2cfff to your computer and use it in GitHub Desktop.
Password Generator
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
import os | |
import string | |
def random_password(length=10): | |
chars = string.ascii_uppercase + string.digits + string.ascii_lowercase | |
password = '' | |
for i in range(length): | |
password += chars[ord(os.urandom(1)) % len(chars)] | |
return password |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment