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

@ -5,24 +5,20 @@ instructionsfile = open('instructions.txt', 'r')
def commandStrip(sentence): def commandStrip(sentence):
for line in dotsfile: for line in dotsfile:
line=line.strip('\n').replace(line, "") line = line.strip('\n').replace(line, "")
return sentence return 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) return found
if 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())))