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)