The Scriptage field guide

Set up Python for automation

A simple working environment for the Python recipes.

Install and check Python

Install Python 3.12 or later from python.org. Follow the installer instructions for your operating system. Open a new terminal after installation and check python --version, python3 --version, or on Windows py --version.

Keep each example together

Extract a recipe into its own folder, then open a terminal there. On Windows you can open Terminal from File Explorer. On macOS or Linux, use cd followed by the folder path. Quote paths containing spaces.

Install only the listed dependencies

Most Python recipes use the standard library. A few media or document tasks require additional packages. If a page lists them, create a virtual environment with python -m venv .venv. Run its Python directly using .venv\Scripts\python.exe on Windows or .venv/bin/python on macOS/Linux, including when installing a package with -m pip install.

Read the available options

Python recipes using argparse show options when you add --help. Read each flag’s purpose before changing it. A flag followed by a path expects a filename or folder; numeric flags expect the units shown in the guide.

Understand the first error

“Command not found” usually concerns the Python installation or command name. “No such file” usually concerns the current folder or input path. “ModuleNotFoundError” concerns a missing dependency in the interpreter you are using. Read the recipe troubleshooting section before changing code.

Put it into practice

Choose one small task from the library, run its example, and change one thing you understand.

Find a beginner script ↗