Now returns our wanted format for the tests and uses a relative path when importing files.

This commit is contained in:
2017-12-16 15:13:51 +01:00
parent c9878ca86a
commit 35d2784a53

View File

@@ -3,10 +3,11 @@
# @Author: KevinMidboe # @Author: KevinMidboe
# @Date: 2017-12-04 16:40:56 # @Date: 2017-12-04 16:40:56
# @Last Modified by: KevinMidboe # @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(): 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() read_data = wordlist.read().splitlines()
wordlist.close() wordlist.close()
return read_data return read_data
@@ -43,6 +44,7 @@ def main():
matches.append(word) matches.append(word)
print(matches, len(matches)) print(matches, len(matches))
return len(matches)
if __name__ == '__main__': if __name__ == '__main__':
main() main()