Possible Duplicate:
What's the best way to grab/parse command line arguments passed to a Python script?
I would like to be able to parse command line arguments in my Python 2.6 program.
Ideally, I want to be able to handle these cases:
# Show some help
./myprogram --help
# These are equivalent
./myprogram --block=1
./myprogram -b 1
# This means verbose, and twice as verbose:
./myprogram -v
./myprogram -vv