June 2017
Beginner to intermediate
274 pages
6h 49m
English
The primary component of the argparse module is the ArgumentParser class. In the minimal case, it only takes three lines of code to use argparse. We need to import it, create an argument parser instance, and call that instance's parse_args() function:

As usual, with minimal cases that's not very useful. The only arguments that the program will respond to are -h or --help, either of which would print out an automatically generated how to use this program message and then exit the program.
The first thing we could do to make the ArgumentParser class more useful is to provide a value for the description parameter ...
Read now
Unlock full access