Parsing options in a PyGTK application

Dear lazyweb, I’m writing an application with Python and GTK+, and I’d like to parse command line arguments. I was thinking of using the PyGTK wrapped version of the Glib option parser, but I can’t find any tutorial for PyObject or application that uses it. Should I just use Python’s optparse instead?

5 thoughts on “Parsing options in a PyGTK application

  1. We use optparse in Virtaal (and basically all of the Translate Toolkit). I can’t think of a reason why you wouldn’t want to use that.

  2. Pingback: Leonardo Ferreira Fontenelle: Parsing options in a PyGTK application | Full-Linux.com

  3. Another vote for argparse. It does the whole job — positional arguments, and options, sub-commands — with a very nice API. It’s all in a single file, so you can bundle argparse.py, should you choose.

Deixe uma resposta

O seu endereço de email não será publicado Campos obrigatórios são marcados *

*

Você pode usar estas tags e atributos de HTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>