Learn subprocess
Run external programs from Python and talk to their input and output
subprocess is the standard way to start other programs from Python, pass them arguments and input, capture their output and react to their exit status. It replaces os.system and shell scripts in build tools, deployment scripts, test harnesses and automation. Learning it well means scripts that are safe from shell injection, never hang, and fail loudly.
Before you start
How deep do you want to go?
1. EssentialsRead and write simple code, do the everyday basics
2. PracticalUse it productively at work, with the usual idioms
3. AdvancedThe less common features, performance and trade-offs
4. ExpertInternals and the edge cases experts know