Ex04_parseargs clarification

I’m working in Learn More Python The Hard Way. I found the instructions for exercise 4 a little too vague, and I think seeing some example output would have possibly helped. Initially in my first 45-minute session I set out to do something vastly more complicated that was required of me, and I didn’t realize it until I checked the solution. My problem was I wasn’t sure what I was supposed to be making. Including the following sentence would have cleared things up:

You just need to interpret the arguments as generic variables somehow and the print out the values.

Perhaps sample output from the solution script might also make it clear, but honestly the above sentence would have helped tremendously. I’ll put it here in case anyone has the same confusion I did:

 $ python3 parseargs.py -h
usage: parseargs.py [-h] [-f FOO] [-b BAR] [-z BAZ] [-t] [-x] [-s] N [N ...]

positional arguments:
  N

optional arguments:
  -h, --help         show this help message and exit
  -f FOO, --foo FOO  foo help
  -b BAR, --bar BAR  bar help
  -z BAZ, --baz BAZ  baz help
  -t, --turn-on
  -x, --exclude
  -s, --start
 $ python3 parseargs.py -f hi! -t -x 5 6 7
Namespace(bar=None, baz=None, exclude=False, foo='hi!', integers=[5, 6, 7], start=False, turn_on=True)

I actually have the code up here https://github.com/zedshaw/learn-more-python-the-hard-way-solutions/ if you want to cheat on any exercise. I’ll be working on this code as I work on the book, so don’t consider it final, just the code from the videos.

My suggestion is you go through the docs for argparse and type in all the examples so you have an idea of how different things work. That’s the first step. Then, from what I see here it looks like you’re on the right track, just need to see how the argparse docs do what you need.