32 lines
772 B
Python
32 lines
772 B
Python
dotsfile = open('dots.txt', 'r')
|
|
wantedfile = open('wanted.txt', 'r')
|
|
keywordsfile = open('keywords.txt', 'w')
|
|
instructionsfile = open('instructions.txt', 'r')
|
|
|
|
def commandStrip(sentence):
|
|
for line in dotsfile:
|
|
line=line.strip('\n').replace(line, "")
|
|
return sentence
|
|
|
|
def searchKeyWords(sentence):
|
|
found = []
|
|
for line in wantedfile:
|
|
line=line.strip('\n')
|
|
if sentence.find(line) >= 0:
|
|
found.append(line)
|
|
|
|
if found:
|
|
return found
|
|
return 1
|
|
|
|
def saveKeyWords(array):
|
|
for line in array:
|
|
keywordsfile.write(line)
|
|
keywordsfile.write("\n")
|
|
|
|
saveKeyWords(searchKeyWords(commandStrip(instructionsfile.read())))
|
|
|
|
dotsfile.close()
|
|
wantedfile.close()
|
|
keywordsfile.close()
|
|
instructionsfile.close() |