A shell script is a text program interpreted by a command shell. A Python script launched from a shell is different: Python executes the file, while the shell starts the command and can redirect its input and output. section 11.0 section 11.2.3
> python replace.py zero 0 < infile > outfile
The shell starts `replace.py` through Python, passes `zero` and `0` as arguments, reads input from `infile`, and writes output to `outfile`. The command demonstrates shell redirection, not the contents of a shell script. section 11.2.3
Command-line execution varies by operating system. macOS can run Python scripts from a terminal; Windows offers Command Prompt, PowerShell, and a Linux environment through Windows Subsystem for Linux. On Windows, the Python executable may need to be added to PATH. section 11.2.2 section 11.2.3
The practical distinction is what interprets the file. The examples here use shell commands to run Python programs, but do not show shell-script syntax or how to write a shell program. section 11.2 section 11.6





