Created
June 8, 2013 08:06
-
-
Save kissgyorgy/5734481 to your computer and use it in GitHub Desktop.
Python: 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
| # http://stackoverflow.com/questions/2257441/python-random-string-generation-with-upper-case-letters-and-digits/2257449#2257449 | |
| def id_generator(size=6, chars=string.ascii_uppercase + string.digits): | |
| return ''.join(random.choice(chars) for x in range(size)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment