Created
June 10, 2012 04:49
-
-
Save toshimaru/2903858 to your computer and use it in GitHub Desktop.
python script which generate random string.
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 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