Skip to content

Instantly share code, notes, and snippets.

@eserge
Created January 13, 2012 12:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eserge/1605923 to your computer and use it in GitHub Desktop.
Save eserge/1605923 to your computer and use it in GitHub Desktop.
simple random string generator
def random_string(length):
'''visually similar characters were deliberately removed'''
import random
letters = u"346789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRTUVWXY"
return "".join([letters[random.randint(0,len(letters)-1)] for i in range(length)])
if __name__ == "__main__":
for i in range(10):
print random_string(10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment