The subprocess Module: Wrapping Programs With Python
If you’ve ever wanted to simplify your command-line scripting or use Python alongside command-line applications—or any applications for that matter—then the Python subprocess module can help. From running shell commands and command-line applications to launching GUI applications, the Python subprocess module can help.
By the end of this tutorial, you’ll be able to:
- Understand how the Python
subprocessmodule interacts with the operating system - Issue shell commands like
lsordir - Feed input into a process and use its output.
- Handle errors when using
subprocess - Understand the use cases for
subprocessby considering practical examples
In this tutorial, you’ll get a high-level mental model for understanding processes, subprocesses, and Python before getting stuck into the subprocess module