Python Argparse Module
Command-line argument parsing — ArgumentParser, add_argument. This category documents 4 Python argparse module entries, and each page gives you the full syntax, the parameter list, the return value, and a runnable example. The entries include: argparse.ArgumentParser(), argparse.add_argument(), argparse.parse_args(), argparse.Namespace. argparse.ArgumentParser() creates an argument parser for processing command-line arguments. argparse.add_argument() defines a command-line argument the parser should accept. argparse.parse_args() parses the command-line arguments and returns a Namespace object. argparse.Namespace the default namespace object used by parse_args(). For a structured walkthrough of the whole topic, read the Argparse Module guide. Argparse Module belongs to the Dev Tools group alongside Inspect Module, Pdb Module, Traceback Module, Timeit Module. You can also search across every category from the search page, browse the complete A–Z index, or try any example in the Python playground. Python Reference documents 978+ functions, methods, and modules across 114 categories of the standard library, and every entry in this Argparse Module category follows the same format — syntax first, then what it does, the parameters it accepts, what it returns, and a working code example — so once you have read one page you can read them all.