14.5 Wrapping a program and checking the output
One common kind of automation involves wrapping a program. The advantage of a Python wrapper is the ability to perform detailed aggregation and analysis of the output files. A Python program might transform, filter, or summarize the output from a subprocess.
In this recipe, we’ll see how to run other applications from within Python, and collect and process the output.
14.5.1 Getting ready
In the Designing scripts for composition recipe in Chapter 13, we identified an application that did some processing, leading to the creation of a rather complex result. We’d like to run this program several hundred times, but we don’t want to copy and paste the necessary commands into a script. Also, because the shell is difficult to test and has so few data structures, we’d like to avoid using the shell.
For this recipe, we’ll work with a native binary application...