From Script to Tool

From Script to Tool: Command-Line Options with argparse, Running a Script on a Schedule.

Updated

  1. Command-Line Options with argparse (Journeyman): 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.
  2. Running a Script on a Schedule (Journeyman): Windows Task Scheduler and cron on a Mac run a script at set times with no terminal open, so the job names the virtual environment's python and the script by their full paths, the script finds its files from its own folder, and logging records each run in a log file.