OptParse and Constant values

J dreadpiratejeff at gmail.com
Thu Aug 12 13:47:53 EDT 2010


On Thu, Aug 12, 2010 at 12:41, Robert Kern <robert.kern at gmail.com> 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 the 'const' keyword to add_option() (it defaults to
> None so that's what you get when you use that flag). This is not what you
> want. You just want the default 'store' action.

Thanks Robert...

Sigh... head -> desk -> repeat :)



More information about the Python-list mailing list