Upload files to ''

This commit is contained in:
Maciej Wrzesiński 2016-11-03 08:14:02 +00:00
parent d74b601c3c
commit d65ae698c9

View File

@ -1,13 +1,13 @@
dotsfile = open('dots.txt', 'r+') dotsfile = open('dots.txt', 'r')
wantedfile = open('wanted.txt', 'r+') wantedfile = open('wanted.txt', 'r')
def commandToArray(sentence): def commandStrip(sentence):
print(sentence)
for line in dotsfile: for line in dotsfile:
line=line.strip('\n') line=line.strip('\n')
sentence = sentence.replace(line, "") sentence = sentence.replace(line, "")
print(sentence) return sentence
def searchKeyWords(sentence):
found = [] found = []
for line in wantedfile: for line in wantedfile:
line=line.strip('\n') line=line.strip('\n')
@ -18,10 +18,10 @@ def commandToArray(sentence):
return found return found
return 1 return 1
def arrayToShit(array): temp = commandStrip("Guten tag, ich want you to pick up big red triangle.")
print("I have found words: " + " ".join(array)) temp = searchKeyWords(temp)
return 0 if temp!=1:
print("I have found words: " + " ".join(temp))
array = commandToArray("HEHEHEHHEHEHEHEHELLO, I want you to give me an eye!?!!") dotsfile.close()
if array!=1: wantedfile.close()
arrayToShit(array)