getopt: Make argument mandatory

Diez B. Roggisch deetsNOSPAM at web.de
Wed Dec 15 09:07:58 EST 2004


> 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.

-- 
Regards,

Diez B. Roggisch



More information about the Python-list mailing list