Maybe this isn't the best way to frame my problem. Right now, I have a program that already uses argparse to enter my class in 'manual' mode. So for example, if I type python parser.py --m
, I go to Parse(args)
, which is my class. This all works fine.
Once this is done, the class parses the file for its table of contents list and prints it to the screen. The table of contents is an OrderedDict with the page number
as the key and the page title
as the value. The idea is that you could press a number and it would print out the text on that respective page, and that you could do this until you type any command that doesn't correspond to a number in the dict.
I was wondering if this would be possible to do with argparse or sys?