Movatterモバイル変換


[0]ホーム

URL:


Up one LevelPython Library ReferenceContentsModule IndexIndex


14.3.3.8 Querying and manipulating your option parser

Sometimes, it's useful to poke around your option parser and see what'sthere. OptionParser provides a couple of methods to help you out:

has_option(opt_str)
Return true if the OptionParser has an option with option stringopt_str (e.g.,-q or--verbose).
get_option(opt_str)
Returns the Option instance with the option stringopt_str, orNone if no options have that option string.
remove_option(opt_str)
If the OptionParser has an option corresponding toopt_str,that option is removed. If that option provided any otheroption strings, all of those option strings become invalid.Ifopt_str does not occur in any option belonging to thisOptionParser, raises ValueError.


Up one LevelPython Library ReferenceContentsModule IndexIndex

Release 2.5.2, documentation updated on 21st February, 2008.
SeeAbout this document... for information on suggesting changes.
[8]ページ先頭

©2009-2025 Movatter.jp