February 2006
Intermediate to advanced
648 pages
14h 53m
English
The getopt module is used to parse command-line options (typically passed in sys.argv).
getopt(args, options [, long_options])Parses the command-line options supplied in the list args. options is a string of letters corresponding to the single-letter options that a program wants to recognize (for example, '-x'). If an option requires an argument, the option letter must be followed by a colon. If supplied, long_options is a list of strings corresponding to long option names. When supplied in args, these options are always preceded by a double hyphen (--), such as in '--exclude' (the leading -- is not supplied in long_options). Long option names requiring an argument should be followed by an equal sign (=). The function returns a list of ...