如何让这个脚本从一个列表中最多替换3个单词的组合?在
在列表.txt由4个字符串组成:pass
10
test
word
而不是从一个词到四个词
^{pr2}$
我希望最后的组合是:output > testpassword, passtestword, 10wordtest,....etc
我的代码:from itertools import permutations
import os
# GET FILE
script_dir = os.path.dirname(os.path.realpath(__file__))
wordlist_rel_path = "List.txt"
wordlist_abs_file_path = os.path.join(script_dir, wordlist_rel_path)
# READ WORD LIST FROM FILE
word_list = []
print ("\ninput file is:", wordlist_abs_file_path,"\n")
with open(wordlist_abs_file_path) as wordlist:
for line in wordlist:
word_list.append(line.rstrip())
# PRINT INPUT LIST
print ("input list contains:")
print(word_list,"\n")
# GENERATE POWERSET
powers