O'Reilly logo

Python: Essential Reference, Third Edition by David Beazley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

optparse

The optparse module provides high-level support for processing command-line options. It provides similar functionality as the getopt module, but adds a considerable number of new features related to configuration, error handling, and option processing. Use of optparse primarily focuses on the OptionParser class.

OptionParser([**args])

Creates a new command option parser and returns an OptionParser instance. A variety of optional keyword arguments can be supplied to control configuration. These keyword arguments are described in the following list:

Keyword ArgumentDescription
add_help_optionSpecifies whether or not a special help option (--help and -h) is supported. By default, this is set to True.
conflict_handlerSpecifies the handling ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required