How to use command line arguments in a Python script with sys.argv and argparse

If you pass command line arguments to a Python script, it's easy to extract and use them with sys.argv. But if you want to build elaborate handlers for command-like arguments, the argparse module in Python's standard library gives you rich tools f...