Skip to main content

Chapter 65 Quiz

Before taking the quiz, verify that you can do each of these without looking at the lessons:

  • Predict what sys.argv contains for a given command
  • Create an argparse parser with positional and optional arguments
  • Set up subcommands with add_subparsers and dispatch with set_defaults
  • Use sys.exit() and sys.stderr to report errors properly
  • Read piped input from sys.stdin and detect pipe vs interactive mode
  • Configure a [project.scripts] entry point in pyproject.toml

If any feel uncertain, revisit the specific lesson before continuing.

Test your understanding of the full Unix-style CLI tool chain by evaluating argument parsing, error handling, composability, and entry point configuration.

Checking access...