Re:Opster: Pythonic option parsing
by makecheck on Monday September 14, 2009 @11:22PM
(#823214)
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.
[ Parent
| on HN ]
Nope. 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.