我想在txt文件中搜索列表元素。然而,使用这段代码,我没有得到期望的结果。我试过几种解决办法,但都不管用
def run(self):
hostname = self.queue.get()
with open('allhosts.txt', "r+") as file1:
fileline1 = file1.readlines()
for x in hostname:
for line in fileline1:
if x in line:
self.found.emit(hostname)
else:
self.notFound.emit(hostname)
在这种情况下使用regx
如果你没有得到输出。请删除文本文件截图
相关问题 更多 >
编程相关推荐