Skip to content

Instantly share code, notes, and snippets.

@hc0d3r
Created May 17, 2013 23:38
Show Gist options
  • Save hc0d3r/5602634 to your computer and use it in GitHub Desktop.
Save hc0d3r/5602634 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# By MMxM
from itertools import product
from sys import argv,exit
print '[+] Programa para gerar todas as combinacoes possiveis\nCom elementos de uma lista\n'
if(len(argv) != 4):
print '[*] Modo de uso: %s <caracteres> <minimo> <maximo>'%argv[0]
print '[*] Exemplo: %s abc 1 3'%argv[0]
exit(1)
l = list(argv[1])
mi = int(argv[2])
ma = int(argv[3])
for n in range(mi,ma+1):
for c in product(l,repeat=n):
s = ''.join(c)
print s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment