On 9/16/07, Greg Ewing <[EMAIL PROTECTED]> wrote: > > Thomas Wouters wrote: > > If you want to put more meaning in the argv list, use an option > > parser. > > I want to put *less* meaning in it, not more. :-)
Then why are you discriminating against argv[0]? It's just another member of the argv list the OS gives us. And using an argument parser is often overkill for > simple programs. So is trying to "fix" this non-issue. > The _actual_ meaning of each element depends entirely on the > > program that's started. For Python-the-language, there isn't any > > difference between them. > > So in your Python programs, you're quite happy > to write > > for arg in sys.argv: > process(arg) > > and not care about what this does with argv[0]? No. I'm quite happy to realize the argv list is what the shell executed. I'm also quite happy to use a proper option parser even for my simple programs. It adds useful defaults even if I didn't think I'd ever use them. I hardly see how one can claim that there's > "no difference" between argv[0] and the rest > for practical purposes. The only meaning is by accident of position. For most programs, the very same thing goes for the rest of the arguments: 'mv foo bar' assigns a different meaning to 'foo' than it does to 'bar'. Notice how sys.argvmatches what the user typed, including sys.argv[0]. -- Thomas Wouters <[EMAIL PROTECTED]> Hi! I'm a .signature virus! copy me into your .signature file to help me spread!
_______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com