Re: Arg decoding with a template?
by Hans-Joachim Widmaier other posts by this author
Aug 2 2001 5:08AM messages near this date
Re: Arg decoding with a template?
|
Re: Arg decoding with a template?
Skip Montanaro <skip@[...].com> wrote in message news:<mailman.996679503.16815.python-list@[
...].org> ...
> Hans-J> I would have written a parser for this under Unix, but I prefer
> Hans-J> to have a consistent interface, which means basically getopt()
> Hans-J> (though I did write my own C getopt()).
>
> Ok, I'll bite. Why write your own C getopt? There are several floating
> around, and there's the standard module delivered with Python. Option
> parsing hardly seems like performance-cricial code.
Well, I did this long before I've heard of GNU and even before our
BDFL started working on a new language called "Python." The C library
getopt() just didn't do all I wanted (allow options after arguments
[this is on thing I really dislike about python's getopt -- it doesn't
allow that; even with modern shells, it's a lot easier to just add a
(forgotten) option after the ten filenames you've just written than to
bring your cursor back and add it there], long options, optional
arguments [to options i.e.], options starting with '+'; so it never
was a question of performance -- it was one of features).
I also needed an option parser for MS-DOS, so I had to write one,
anyway. Granted, I probably wouldn't do it again, now, but since its
there and rather convenient, I keep using it. In my python programs, I
stick with the getopt module.
Hans-J.
--
http://mail.python.org/mailman/listinfo/python-list
Thread:
Dale Strickland-Clark
David Bolen
Jim Dennis
Marcin 'Qrczak' Kowalczyk
Chui Tey
David Bolen
Hans-Joachim Widmaier
Hans-Joachim Widmaier
Skip Montanaro
Quinn Dunkan
Dale Strickland-Clark
David Bolen
Steve Holden
David Bolen
Alex Martelli
Dale Strickland-Clark
Dale Strickland-Clark
Skip Montanaro
David Bolen
Peter Wang
Steve Holden
David Bolen
Steve Holden
Skip Montanaro
|