# Command-Line Options with argparse

The words typed after a script's name arrive in sys.argv, and the argparse module turns them into a positional argument, options with defaults and flags, checks them, and writes a --help page, so one script works on any folder without editing its code.

![Cheat sheet: Command-Line Options with argparse](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/3efce6eedfe64f02871d9be1a761ec76.webp)

- Category: Python
- Level: Journeyman
- Tags: argparse, Command-Line Argument (python), flags-and-options, python, sys.argv
- Author: Gregor Dzierzon
- Updated: November 23, 2026

Source: https://www.ask-codey.com/cheat-sheets/python-automation-command-line-arguments-cheat-sheet
