# IdeaGen v0.1
# License: Public Domain
import itertools
def func(n):
with open("wordslist.txt") as file:
words = file.read().splitlines()
with open('output', 'w') as file:
text = '\n'.join(mmap(' '.join, combinations(words, n)))
file.write(text)
if __name__ == '__main__':
func(2)
func(3)
Traceback (most recent call last):
File "./prog.py", line 15, in <module>
File "./prog.py", line 7, in func
FileNotFoundError: [Errno 2] No such file or directory: 'wordslist.txt'