sick_file_update_must_see.mp4

This commit is contained in:
Maciej Wrzesiński 2016-11-17 08:02:24 +00:00
parent aa695f993d
commit 9c7fbaa54b

View File

@ -11,18 +11,14 @@ def commandStrip(sentence):
def searchKeyWords(sentence): def searchKeyWords(sentence):
found = [] found = []
for line in wantedfile: for line in wantedfile:
line=line.strip('\n') if sentence.find(line.strip('\n')) >= 0:
if sentence.find(line) >= 0: found.append(line.strip('\n'))
found.append(line)
if found:
return found return found
return 1
def saveKeyWords(array): def saveKeyWords(array):
for line in array: for line in array:
keywordsfile.write(line) if line != '':
keywordsfile.write("\n") keywordsfile.write(line + '\n')
saveKeyWords(searchKeyWords(commandStrip(instructionsfile.read()))) saveKeyWords(searchKeyWords(commandStrip(instructionsfile.read())))