argparse

argparse is the standard module for defining a script's command-line arguments: positional arguments, options, default values, types and automatic help with --help. It validates the arguments and displays a clear error message on incorrect usage.

Example

p = argparse.ArgumentParser()
p.add_argument('--dossier', default='.')
args = p.parse_args()

Related concepts

The whole glossary