From d65ae698c97a443ba78a8984f2dbc646f001ab90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Wrzesi=C5=84ski?= Date: Thu, 3 Nov 2016 08:14:02 +0000 Subject: [PATCH] Upload files to '' --- projektkck.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/projektkck.py b/projektkck.py index 288ade2..9837a56 100644 --- a/projektkck.py +++ b/projektkck.py @@ -1,13 +1,13 @@ -dotsfile = open('dots.txt', 'r+') -wantedfile = open('wanted.txt', 'r+') +dotsfile = open('dots.txt', 'r') +wantedfile = open('wanted.txt', 'r') -def commandToArray(sentence): - print(sentence) +def commandStrip(sentence): for line in dotsfile: line=line.strip('\n') sentence = sentence.replace(line, "") - print(sentence) + return sentence +def searchKeyWords(sentence): found = [] for line in wantedfile: line=line.strip('\n') @@ -18,10 +18,10 @@ def commandToArray(sentence): return found return 1 -def arrayToShit(array): - print("I have found words: " + " ".join(array)) - return 0 +temp = commandStrip("Guten tag, ich want you to pick up big red triangle.") +temp = searchKeyWords(temp) +if temp!=1: + print("I have found words: " + " ".join(temp)) -array = commandToArray("HEHEHEHHEHEHEHEHELLO, I want you to give me an eye!?!!") -if array!=1: - arrayToShit(array) +dotsfile.close() +wantedfile.close() \ No newline at end of file