argparse.ArgumentParser.print_usage()

ArgumentParser.print_usage(file=None) Print a brief description of how the ArgumentParser should be invoked on the command line. If file is None, sys.stdout is assumed.

argparse.ArgumentParser.print_help()

ArgumentParser.print_help(file=None) Print a help message, including the program usage and information about the arguments registered with the ArgumentParser. If file is None, sys.stdout is assumed.

argparse.ArgumentParser.parse_known_args()

ArgumentParser.parse_known_args(args=None, namespace=None)

argparse.ArgumentParser.parse_args()

ArgumentParser.parse_args(args=None, namespace=None) Convert argument strings to objects and assign them as attributes of the namespace. Return the populated namespace. Previous calls to add_argument() determine exactly what objects are created and how they are assigned. See the documentation for add_argument() for details. By default, the argument strings are taken from sys.argv, and a new empty Namespace object is created for the attributes.

argparse.ArgumentParser.get_default()

ArgumentParser.get_default(dest) Get the default value for a namespace attribute, as set by either add_argument() or by set_defaults(): >>> parser = argparse.ArgumentParser() >>> parser.add_argument('--foo', default='badger') >>> parser.get_default('foo') 'badger'

argparse.ArgumentParser.format_usage()

ArgumentParser.format_usage() Return a string containing a brief description of how the ArgumentParser should be invoked on the command line.

argparse.ArgumentParser.format_help()

ArgumentParser.format_help() Return a string containing a help message, including the program usage and information about the arguments registered with the ArgumentParser.

argparse.ArgumentParser.exit()

ArgumentParser.exit(status=0, message=None) This method terminates the program, exiting with the specified status and, if given, it prints a message before that.

argparse.ArgumentParser.error()

ArgumentParser.error(message) This method prints a usage message including the message to the standard error and terminates the program with a status code of 2.

argparse.ArgumentParser.convert_arg_line_to_args()

ArgumentParser.convert_arg_line_to_args(arg_line) Arguments that are read from a file (see the fromfile_prefix_chars keyword argument to the ArgumentParser constructor) are read one argument per line. convert_arg_line_to_args() can be overridden for fancier reading. This method takes a single argument arg_line which is a string read from the argument file. It returns a list of arguments parsed from this string. The method is called once per line read from the argument file, in order. A usefu