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?

Esta entrada foi publicada em Classix, GNOME, Software livre e marcada com a tag . Adicione o link permanenteaos seus favoritos.

5 respostas a Parsing options in a PyGTK application

  1. F Wolff disse:

    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. No' disse:

    nice alternative: http://code.google.com/p/argparse/ – parses both arguments and options

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

  4. Alex Willmer disse:

    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>