Skip to content

Instantly share code, notes, and snippets.

@gurglet
Created April 23, 2012 08:31
Show Gist options
  • Save gurglet/2469559 to your computer and use it in GitHub Desktop.
Save gurglet/2469559 to your computer and use it in GitHub Desktop.
Random codes
import random
import string
def random_code():
available_chars = string.uppercase + string.digits
return ''.join(random.choice(available_chars) for i in xrange(8))
for i in xrange(10):
print "code %d: %s" % (i, random_code())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment