Website hosting service by Active-Venture.com
  

 Back to Index


6.20.3.5 Querying and manipulating your option parser

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

 

 
has_option( opt_str)
Given an option string such as -q or --verbose, returns true if the OptionParser has an option with that option string.

 

 
get_option( opt_str)
Returns the Option instance that implements the option string you supplied, or None if no options implement it.

 

 
remove_option( opt_str)
If the OptionParser has an option corresponding to opt_str, that option is removed. If that option provided any other option strings, all of those option strings become invalid.

If opt_str does not occur in any option belonging to this OptionParser, raises ValueError.

 

  

 

© 2002-2004 Active-Venture.com Webhosting Service

 

Disclaimer: This documentation is provided only for the benefits of our hosting customers.
For authoritative source of the documentation, please refer to http://python.org/doc/

 

Active-Domain.com offers domain name registration, domain name transfer and domain search services  

Cheap domain registration : Register domain name or buy domain name, including free domain hosting services

 
 

Domain registration : Buy domain name or register domain name from $5.95/year only