Skip to content

Instantly share code, notes, and snippets.

@toshimaru
Created June 10, 2012 04:49
Show Gist options
  • Save toshimaru/2903858 to your computer and use it in GitHub Desktop.
Save toshimaru/2903858 to your computer and use it in GitHub Desktop.
python script which generate random string.
import string
from random import randrange
LENGTH = 10
alphabets = string.digits + string.letters
def randstr(n):
return ''.join(alphabets[randrange(len(alphabets))] for i in xrange(n))
if __name__ == '__main__':
print randstr(LENGTH)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment