diff --git a/count_word.py b/count_word.py index e69de29..6d79994 100644 --- a/count_word.py +++ b/count_word.py @@ -0,0 +1,12 @@ +def countWord(filepath,word): + file = open(filepath) + textWord = None + count = 0 + while(textWord != ""): + textWord = file.readline() + if (word in textWord): + count += 1 + + return count + +print countWord("files/testfile.txt",'typesetting') diff --git a/count_word.pyc b/count_word.pyc new file mode 100644 index 0000000..ed9ac5b Binary files /dev/null and b/count_word.pyc differ diff --git a/tests/__init__.pyc b/tests/__init__.pyc new file mode 100644 index 0000000..ea616ea Binary files /dev/null and b/tests/__init__.pyc differ diff --git a/tests/test_countWord.pyc b/tests/test_countWord.pyc new file mode 100644 index 0000000..63a25bf Binary files /dev/null and b/tests/test_countWord.pyc differ