Created
October 27, 2015 17:10
-
-
Save galileoguzman/43d60da9fb3243f824a9 to your computer and use it in GitHub Desktop.
Generate random string with digits
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
# function definition | |
def generate_public_key(self): | |
#import libs | |
import string | |
import random | |
# make magic | |
k = ''.join([random.choice(string.ascii_letters + string.digits) for n in xrange(255)]) | |
#return the value | |
return k |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment