Python
Command Line Arguments and Exit Codes
sys.argv holds what the user typed, stdout carries results, stderr carries problems, and the exit code tells the shell whether it worked.
Command line arguments, sys.argv, argparse, flags, help text, validation and exit codes.
2 notes
sys.argv holds what the user typed, stdout carries results, stderr carries problems, and the exit code tells the shell whether it worked.
argparse turns a description of your options into a parser, a validator and a help page. It is the standard way to give a Python script a real interfa...