3 ms·
I think what you're looking for is the parse_args() method, which returns a pair; one part is the named option values, the other part is everything that's left.
by makecheck 17y ago
I think what you're looking for is the parse_args() method, which returns a pair; one part is the named option values, the other part is everything that's left. So you handle positional arguments by iterating over the "what's left" part.
- DannoHung 17y agoNope. I still need to # Check which arguments are available # Cast them # Provide utilization information for the arguments # Provide defaults # Do all the other stuff that optparse does for options Hmm... I guess Google's argparse really is the future.