Hello World!<br>This is my first post on the list and I'm hoping it is the right forum and not OT, I've searched<br>a bit on this, but, none-the-wiser!<br><br>My question is on the Popen method, here is my snippet:<br>
<br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">p1 = Popen(["cat", "georgi_ddr7_allmag_kcor_in_test.dat"], stdout=PIPE )<br>
p2 = Popen(["fit_coeffs"], stdin=p1.stdout, stdout=PIPE)<br>
p3 = Popen(["reconstruct_maggies"], stdin=p2.stdout,stdout=PIPE)<br>
output_maggies_z=p3.communicate()[0]<br><br>p1 = Popen(["cat", "georgi_ddr7_allmag_kcor_in_test.dat"], stdout=PIPE )<br>p2 = Popen(["fit_coeffs"], stdin=p1.stdout, stdout=PIPE)<br>p4 = Popen(["reconstruct_maggies", "--band-shift", "0.1", "--redshift", "0."], stdin=p2.stdout,stdout=PIPE)<br>


output_maggies_z0=p4.communicate()[0]<br><br></blockquote>
<br>That is, p1 and p2 are the same, but p3 and p4 which they are passed to, are different.<br>Is there a way to pass p1 and p2 to p3 AND p4 simultaneously, so as to not need to<br>run p1 and p2 twice, as above?<br>What arguments would I need to achieve this?<br>
<br>NOTE: "georgi_ddr7_allmag_kcor_in_test.dat" is a very large file (~1E6 records)<br><br>regards,<br>- Sebastian<br><br>