Retry:Question about optparse/OptionParser callback.

Steven Bethard steven.bethard at gmail.com
Sun Feb 11 01:01:34 EST 2007


Steven W. Orr wrote:
> I'm writing a program that needs to process options. Due to the nature 
> of the program with its large number of commandline options, I would 
> like to write a callback to be set inside add_option.
> 
> Something like this:
> 
> parser.add_option("-b", action="callback", callback=optionhandlr, dest='b')

What do you want your callback to do? Actually, a better question is, 
what do you want to happen when the user specifies "-b" at the command line?

STeVe



More information about the Python-list mailing list