def load_names(path): with open(path) as text_file: return text_file.read().splitlines() names = load_names('names.txt')