MsRewards-Reborn/modules/Classes/WordList.py

14 lines
305 B
Python
Raw Permalink Normal View History

import random
class WordList:
def __init__(self, path):
with open(path, "r", encoding="utf-8") as h:
lines = h.readlines()
self.words = [x.replace('\n', "") for x in lines]
random.shuffle(self.words)
def get_word(self):
return self.words.pop(0)