Skip to content

Instantly share code, notes, and snippets.

@fukata
Created May 6, 2011 13:01
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 fukata/958912 to your computer and use it in GitHub Desktop.
Save fukata/958912 to your computer and use it in GitHub Desktop.
Random Characters
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def random_chars(num=36):
import random
chars = "asdfghjkqwertyuopzxcvbnm1234567890ASDFGHJKLZXCVBNMQWERTYUOP"
strs = [random.choice(chars) for x in range(num)]
return ''.join(strs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment