getopt: Make argument mandatory

Frans Englich frans.englich at telia.com
Thu Dec 16 20:41:40 CET 2004


On Wednesday 15 December 2004 14:07, Diez B. Roggisch wrote:
> > In my use of getopt.getopt, I would like to make a certain parameter
> > mandatory. I know how to specify such that a parameter must have a value
> > if it's specified, but I also want to make the parameter itself
> > mandatory(combined with a mandatory value, the result is that the user
> > must specify a value).
>
> Use optparse - in the examples section you'll find what you need.

I'm slow here, do you mean in of the callback examples in 6.21.4?

http://docs.python.org/lib/module-optparse.html


Cheers,

		Frans




More information about the Python-list mailing list