I am looking to set a text file rand.letter.txt
as the default word file in this argparse segment, to be used and read in the program. I would assume this should be situated in row 4-5 down below. How should I do this?
As you will see I have already done that with the matrix size. But I am struggling when in regards of a file with str characteristics.
def main():
print("WELCOME TO THE MEMORY PUZZLE!")
parser = argparse.ArgumentParser(description="Memory game")
parser.add_argument("words_file", metavar="FILE", nargs=1,
help="Words file")
parser.add_argument(
"--matrix-size",
metavar="SIZE",
dest="matrix_size",
help="Matrix size",
default=6,
type=int,
)
args = parser.parse_args()
game = Game(args.words_file[0], args.matrix_size)
game.play()
Thank you so much for any help or input!