[EMAIL PROTECTED] wrote:

> py>    parser.add_option("-n", "--name", dest="name", action="store",
> py>                           help="enter a name")
 > py>    parser.add_option("-u", "--url", action="store", dest="url",
 > help = "enter an url")

It's worth noting that this will have the same effect and involves less 
repetitive typing:

parser.add_option("-n", "--name", help="enter a name")
parser.add_option("-u", "--url", help="enter a url")

Discovering this has made optparse usage much more painless for me, and 
also reduces the incidence of those nasty multiple line option additions.

Although I should note for the record that I agree with Peter Hansen 
that if the arguments are not *optional* then they should not be made 
options in this manner.
-- 
Michael Hoffman
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to