On Thu, Aug 12, 2010 at 12:41, Robert Kern wrote:
> On 8/12/10 11:19 AM, J wrote:
>>
>> How do you use OptParse with constants?
> http://docs.python.org/library/optparse#standard-option-actions
>
> 'store_const' means that the option is a flag without arguments and stores
> the value provided by
On 8/12/10 11:19 AM, J wrote:
How do you use OptParse with constants?
Example:
usage = 'Usage: %prog [OPTIONS]'
parser = OptionParser(usage)
parser.add_option('-l','--level',
action='store_const',
default=LOG_INFO,
he
How do you use OptParse with constants?
Example:
usage = 'Usage: %prog [OPTIONS]'
parser = OptionParser(usage)
parser.add_option('-l','--level',
action='store_const',
default=LOG_INFO,
help='Set the log level to inject into