This week I learned more about *args. I was using subprocess.run to execute a shell command and I didn’t want to type out the individual arguments.

The docs say

Run the command described by args. Wait for command to complete, then return a CompletedProcess instance.

So what if I pass in the arguments as an array?

cmd = 'find . -name foo'
subprocess.run(cmd.split())

Sure enough, this works.