Skip to content

Instantly share code, notes, and snippets.

@galileoguzman
Created October 27, 2015 17:10
Show Gist options
  • Save galileoguzman/43d60da9fb3243f824a9 to your computer and use it in GitHub Desktop.
Save galileoguzman/43d60da9fb3243f824a9 to your computer and use it in GitHub Desktop.
Generate random string with digits
# 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