Pārlūkot izejas kodu

adding get words function.

master
Charles Reid pirms 3 gadiem
vecāks
revīzija
b16c360103
1 mainītis faili ar 19 papildinājumiem un 0 dzēšanām
  1. +19
    -0
      get_words.py

+ 19
- 0
get_words.py Parādīt failu

@@ -0,0 +1,19 @@
"""
get_words.py

Utility method to load the SBG words
and retun them as a list of strings.
"""

def get_words():
# Load the file.
with open('sgb-words.txt','r') as f:
## This includes \n at the end of each line:
#words = f.readlines()
# This drops the \n at the end of each line:
words = f.read().splitlines()

return words



Notiek ielāde…
Atcelt
Saglabāt