From 35d2784a53ef55ed4e4466e9115b22c2d978bb0b Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Sat, 16 Dec 2017 15:13:51 +0100 Subject: [PATCH] Now returns our wanted format for the tests and uses a relative path when importing files. --- luke_04/not_pal_but_an.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/luke_04/not_pal_but_an.py b/luke_04/not_pal_but_an.py index c6acb7a..7535f1b 100755 --- a/luke_04/not_pal_but_an.py +++ b/luke_04/not_pal_but_an.py @@ -3,10 +3,11 @@ # @Author: KevinMidboe # @Date: 2017-12-04 16:40:56 # @Last Modified by: KevinMidboe -# @Last Modified time: 2017-12-04 20:20:28 +# @Last Modified time: 2017-12-16 14:09:31 +import os def get_wordlist(): - with open('./ordliste.txt', 'r') as wordlist: + with open(os.path.dirname(__file__) + '/ordliste.txt', 'r') as wordlist: read_data = wordlist.read().splitlines() wordlist.close() return read_data @@ -43,6 +44,7 @@ def main(): matches.append(word) print(matches, len(matches)) + return len(matches) if __name__ == '__main__': - main() \ No newline at end of file + main()