Skip to content

Instantly share code, notes, and snippets.

@nimaid
Last active April 5, 2017 12:43
Show Gist options
  • Save nimaid/2d5b5153d4657426f9d049cebf0196e9 to your computer and use it in GitHub Desktop.
Save nimaid/2d5b5153d4657426f9d049cebf0196e9 to your computer and use it in GitHub Desktop.
Python random string gen
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