Python optparse Module
Example
Access the OptionParser class name (no arguments parsed):
import optparse
print(optparse.OptionParser.__name__)
Try it Yourself »
Warning: optparse is deprecated. Use argparse instead.
Definition and Usage
The optparse module provides a command-line option parser.
It is deprecated in favor of argparse, which offers more features and better design.
Members
Member | Description |
---|---|
OptionParser | Main class for defining and parsing options (deprecated). |
Option | Represents a single command-line option (deprecated). |