Skip to content

Instantly share code, notes, and snippets.

@TheBits
Created November 15, 2010 16:22
Show Gist options
  • Save TheBits/700536 to your computer and use it in GitHub Desktop.
Save TheBits/700536 to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
# ha-ha!
import itertools
DICTIONARY = 'abc123'
LIMIT = 3
out_file = 'out.log'
with open(out_file, 'w') as file:
for i in itertools.product(DICTIONARY, repeat=LIMIT):
print ''.join(i)
file.write("%s\n" % ''.join(i))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment