|
|
|
|
|
by mr_dbr
6114 days ago
|
|
A lot? There's about two lines I'd consider "boiler plate" (three if you count the import) from optparse import OptionParser
parser = OptionParser() # initialise parser
parser.add_option(...) # add option 1
parser.add_option(...) # add option 2
(options, args) = parser.parse_args() # run parser, get values
..and the sample add_option call: parser.add_option(
"-q",
"--quiet",
action="store_false",
dest="verbose",
default=True,
help="don't print status messages to stdout")
I don't see anything repetitive, nor unnecessarily object-oreiented |
|