Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #111168

Re: Spot the bug: getoptquestion.py

From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Subject Re: Spot the bug: getoptquestion.py
Date 2016-07-06 14:14 +1000
Message-ID <mailman.118.1467778498.2295.python-list@python.org> (permalink)
References (3 earlier) <577a58b9$0$5902$e4fe514c@news.xs4all.nl> <CAPTjJmpjELQE21n18jmW1_QV=DHd6fL_T=vW852BVFWzFvEv4A@mail.gmail.com> <mailman.68.1467639747.2295.python-list@python.org> <a588eed6-bfac-4cc9-be4a-f6ce188247b0@googlegroups.com> <CAPTjJmqOEqcj=CvUYtD=QZ4khygAANW-iJBNne0VY0Ebo_qAPg@mail.gmail.com>

Show all headers | View raw


On Wed, Jul 6, 2016 at 2:04 PM, Lawrence D’Oliveiro
<lawrencedo99@gmail.com> wrote:
> On Tuesday, July 5, 2016 at 1:42:42 AM UTC+12, Chris Angelico wrote:
>
>> The getopt module is designed to match the C getopt function, which I've
>> never used; for my command-line parsing, I use argparse instead
>> (usually via some wrapper that cuts down the duplication, like clize).
>
> getopt seems so much simpler.

Look at clize:

https://github.com/Rosuav/LetMeKnow/blob/master/letmeknow.py

I just put docstrings on my functions, slap "@command" above them, and
with minimal boilerplate, I have a fully-working command line
interface. It's a wrapper around argparse.

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Spot the bug: getoptquestion.py Chris Angelico <rosuav@gmail.com> - 2016-07-04 21:36 +1000
  Re: Spot the bug: getoptquestion.py jornws0718@xs4all.nl (Oscar) - 2016-07-04 12:38 +0000
    Re: Spot the bug: getoptquestion.py Chris Angelico <rosuav@gmail.com> - 2016-07-04 23:42 +1000
      Re: Spot the bug: getoptquestion.py Lawrence D’Oliveiro <lawrencedo99@gmail.com> - 2016-07-05 21:04 -0700
        Re: Spot the bug: getoptquestion.py Chris Angelico <rosuav@gmail.com> - 2016-07-06 14:14 +1000
          Re: Spot the bug: getoptquestion.py jornws0718@xs4all.nl (Oscar) - 2016-07-07 11:30 +0000
            Re: Spot the bug: getoptquestion.py Chris Angelico <rosuav@gmail.com> - 2016-07-07 22:12 +1000
              Re: Spot the bug: getoptquestion.py jornws0718@xs4all.nl (Oscar) - 2016-07-07 12:29 +0000
            Re: Spot the bug: getoptquestion.py Steven D'Aprano <steve@pearwood.info> - 2016-07-26 11:12 +1000

csiph-web