On 21/08/06, Tony Cappellini <[EMAIL PROTECTED]> wrote: > 1. check the number of arguments as well as checking that each argument was > valid. > 4. If the argument validation failed, a Usage() function would be called to > show all possible arguments > 5. Provide a "help" option to display all the possible arguments.
Hi, I haven't read your whole post, I'm afraid, but I did see that you were using getopt. If you use optparse instead, it will take care of all this for you. Basically, you create a parser, and tell it what arguments you are expecting, including: - short name - long name - help text - argument type (int / string / float / bool) - default value If you give your script the -h or --help option, optparse will generate usage text (which you can customise). Likewise, if you give it an unknown argument, or an argument of the wrong type. I've only just started playing with it myself, but it looks pretty nifty :-) -- John. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor