<br><br><div><span class="gmail_quote">On 9/16/07, <b class="gmail_sendername">Greg Ewing</b> <<a href="mailto:greg.ewing@canterbury.ac.nz">greg.ewing@canterbury.ac.nz</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thomas Wouters wrote:<br>> If you want to put more meaning in the argv list, use an option<br>> parser.<br><br>I want to put *less* meaning in it, not more. :-)</blockquote><div><br>Then why are you discriminating against argv[0]? It's just another member of the argv list the OS gives us.
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">And using an argument parser is often overkill for<br>simple programs. </blockquote>
<br>So is trying to "fix" this non-issue.<br><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">> The _actual_ meaning of each element depends entirely on the
<br>> program that's started. For Python-the-language, there isn't any<br>> difference between them.<br><br>So in your Python programs, you're quite happy<br>to write<br><br> for arg in sys.argv:<br> process(arg)
<br><br>and not care about what this does with argv[0]?</blockquote><div><br>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.
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I hardly see how one can claim that there's<br>"no difference" between argv[0] and the rest
<br>for practical purposes.</blockquote><div><br>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.argv matches what the user typed, including sys.argv[0].<br></div></div><br>-- <br>Thomas Wouters <<a href="mailto:thomas@python.org">thomas@python.org</a>><br><br>Hi! I'm a .signature virus! copy me into your .signature file to help me spread!