I am trying to capture the output of a process I launch through python for logging purposes. But for some reason despite all my attempts none of the solutions seems to be working for this particular case. Can someone help? My code looks like this:
cmd = 'cat input.fq | fastx_clipper -Q33 -a TGGAATTCTCGGGTGCC -l 5 -c -n -v | fastx_trimmer -Q33 -f 2 > ../results/trimmed.fq' p = Popen(cmd,shell=True,stdout = PIPE) for line in p.stdout:output.write(line)
../results/trimmed.fqwith your shell command, so why would you be expecting any output from stdout?> ../results/trimmed.fq. If you run that command in a terminal, do you see any output? Or is everything being dumped to that file?