Feb. 12, 2002
10:23 a.m.
I like the general direction but one thing makes me a little confused... Russ Cox wrote:
...
for o in opt: if o=='-n' or o=='--num': ncopies = opt.optarg(opt.needtype(int))
How does "opt" know that I am looking for the arguments to the --num command line argument and not the --file one? I guess I would expect an interface more like: for o, value in opt: if o=='-n' or o=='--num': ncopies = optparser.needtype(value, 'integer') Paul Prescod