I read everything that is on subprocess.Popen, but I think something is missing.
I need to be able to execute a unix program that reads a data stream from a list created in a python script and writes the result of this program to a file. From the bash prompt, I do this all the time without problems, but now I'm trying to do this from within a python script that preprocesses some binary files and a lot of data before proceeding with this step.
Let's look at a simple example that does not include all the preprocessing:
import sys from pylab import * from subprocess import * from shlex import split
The way this will run in bash is:
echo "11 31 13 33 15 37 16 35 17 38 18 39.55" | my_unix_prog option1 option2 .... > outfile
The way data is passed to the unix program is also important, I have to format it in 2 columns, separated by spaces.
Any help is appreciated ...
source share