http://stackoverflow.com/a/30493366/188963
Other answers do mention that argparse
is the way to go for new Python, but do not give usage examples. For completeness, here is a short summary of how to use argparse:
1) Initialize
import argparse
# Instantiate the parser
parser = argparse.ArgumentParser(description='Optional app description')