Python Library Reference
Previous: Up: 6.21.2 Tutorial Next:


6.21.2.1 Understanding option actions

Actions tell optparse what to do when it encounters an option on the command line. There is a fixed set of actions hard-coded into optparse; adding new actions is an advanced topic covered in section , Extending optparse. Most actions tell optparse to store a value in some variable--for example, take a string from the command line and store it in an attribute of options.

If you don't specify an option action, optparse defaults to store.


Python Library Reference
Previous: Up: 6.21.2 Tutorial Next:

Release 2.4.4, documentation updated on 18 October 2006.
See About this document... for information on suggesting changes.

AltStyle によって変換されたページ (->オリジナル) /