【发布时间】:2017-05-11 09:33:25
【问题描述】:
我正在用 Python 编写一个脚本来生成蛮力单词表。我已经只能连接字符串,但是我不能在列表中每个单词的最后连接一些随机数,因为它说我不能连接 str 和 int 对象......
代码:
wList = []
words = raw_input("[+]Insert the words that you wish: ")
outputFile = raw_input("[+]Insert the path to save the file: ")
wordList = words.split(",")
for x in wordList:
for y in wordList:
wList.append(x + y)
wList.append(y + x)
wList.append(x + "-" + y)
wList.append(y + "-" + x)
wList.append(x + "_" + y)
wList.append(y + "_" + x)
wList.append(x + "@" + y)
wList.append(y + "@" + x)
for num in wordList:
for num2 in wordList:
for salt in range(1,10):
wList.append(num + num2 + int(salt))
wList.append(num2 + num + int(salt))
【问题讨论】:
标签: python string list int concatenation