[Python-3000] Move argv[0]? (Re: Unicode and OS strings)

Greg Ewing greg.ewing at canterbury.ac.nz
Mon Sep 17 06:04:11 CEST 2007


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. :-)
And using an argument parser is often overkill for
simple programs.

> 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]?

I hardly see how one can claim that there's
"no difference" between argv[0] and the rest
for practical purposes.

-- 
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | Carpe post meridiem!          	  |
Christchurch, New Zealand	   | (I'm not a morning person.)          |
greg.ewing at canterbury.ac.nz	   +--------------------------------------+


More information about the Python-3000 mailing list