writing command-line options into file

hiral hiralsmaillist at gmail.com
Mon Mar 14 08:13:37 EDT 2011


For following example, how to write command-line option OR metavar
into file...

parser.add_option("-opt1", metavar="MY_OPTION1", default=123)
parser.add_option("-opt2", metavar="YOUR_OPTION2" ,default= "abc")
parser.add_option('-opt3", metavar="FLAG", default=True)

do we have any facility to write command-line option OR 'metavar' into
file as follow...

output_file:
MY_OPTION1 123
YOUR_OPTION2 abc
FLAG True

OR
output_file:
opt1 123
opt2 abc
opt3 True

Any idea?

Please note that in actual application there are about 80 to 90
command-line options.

Thank you in advance.



More information about the Python-list mailing list