Overview
Teaching: 15 min
Exercises: 15 minQuestions
How can I write command-line utilities in Python?
Objectives
Write programs that process command-line arguments in
sys.argv
directly.Write programs that use the
argparse
library to process command-line arguments.Write programs that read from standard input and write to standard output.
FIXME
Key Points
Get command-line arguments from
sys.argv
.Read from
sys.stdin
and write tosys.stdout
.Provide a meaningful usage message.