Supporting CLI programs in `subprocess.run` on macOS & Windows without `shell=True`

from blog Alex W.'s Blog, | ↗ original
In Windows, subprocess.run uses CreateProcess (docs) which (appears to?) only identify .exe files by default. Therefore when trying to run something like the heroku CLI using subprocess.run('heroku') it fails with [WinError 2] The system cannot find the file specified. Using where heroku I can see that it has two executables at: C:\Program...