import itertools as its
words = '01www'
r = its.product(words,repeat=9)
for i in r:
print ''.join(i)
itertools用于高效循环的迭代函数集合,相当于无限迭代器,repeat是限制次数,这里用他来限制生成的位数
import itertools as its
words = '01www'
r = its.product(words,repeat=9)
for i in r:
print ''.join(i)
itertools用于高效循环的迭代函数集合,相当于无限迭代器,repeat是限制次数,这里用他来限制生成的位数