I’m brand new to python. I have a text file full of strings. I want to see which of these multiple strings contain a set of keywords. I’ve managed to write this:
f = open('C:\\blah\\list.txt')
for line in f:
if 'keyword' in line:
print line
Which works great! Its just, I have a lot of keywords to search, so I imagine I want to get an array in there somehow but I’ve looked, and can’t find out how to do this.
Thanks
Are you searching for lines with all keywords included?
or with any of them? In the latter case replace the
allwithany.