The scripts we have generated in previous chapters have all had "hard-coded" inputs. The input values were written in the script as strings or numbers, and assigned to variables. While they can be updated manually to replace the input and output file paths and SQL statements, programmers should aim to create reusable code. Scripts should be designed to be dynamic, accepting file paths and other inputs as parameters or arguments. Like Python functions, scripts should accept parameters, process the data, and produce a result.
Python was designed with this in mind, and dynamic parameters can be passed to scripts when executed. How are parameters, also known as arguments, passed to the script? There are a few methods. When running a script in the command line, script parameters are passed to the script separated by spaces, in the order...