Last active
April 5, 2017 12:43
-
-
Save nimaid/2d5b5153d4657426f9d049cebf0196e9 to your computer and use it in GitHub Desktop.
Python random string gen
This file contains 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 random | |
random.seed() | |
def rand_str(str_len, chars = '01234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM'): | |
ret_str = '' | |
for x in range(str_len): | |
ret_str += random.choice(chars) | |
return ret_str |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment