subprocess.Popen question

2011-08-16 Thread Danny Wong (dannwong)
Hi All, I'm executing a command which I want to capture the standard/stderr output into a file (which I have with the code below), but I also want the standard output to go into a variable so I can process the information for the next command. Any ideas? Thanks. CMD_OUTPUT =

Re: subprocess.Popen question

2011-08-16 Thread Chris Rebert
On Tue, Aug 16, 2011 at 12:03 AM, Danny Wong (dannwong) dannw...@cisco.com wrote: Hi All,        I'm executing a command which I want to capture the standard/stderr output into a file (which I have with the code below), but I also want the standard output to go into a variable so I can

Re: subprocess.Popen question

2011-08-16 Thread Thomas Rachel
Am 16.08.2011 09:03 schrieb Danny Wong (dannwong): Hi All, I'm executing a command which I want to capture the standard/stderr output into a file (which I have with the code below), but I also want the standard output to go into a variable so I can process the information for the next

Re: subprocess.Popen question

2011-08-16 Thread Nobody
On Tue, 16 Aug 2011 02:03:50 -0500, Danny Wong (dannwong) wrote: I'm executing a command which I want to capture the standard/stderr output into a file (which I have with the code below), but I also want the standard output to go into a variable so I can process the information for the

Re: subprocess.popen question

2007-06-25 Thread [EMAIL PROTECTED]
On Jun 23, 6:46 am, SPE - Stani's Python Editor [EMAIL PROTECTED] wrote: On Jun 23, 5:35 am, Gabriel Genellina [EMAIL PROTECTED] wrote: En Fri, 22 Jun 2007 10:08:49 -0300, [EMAIL PROTECTED] [EMAIL PROTECTED] escribió: I seemed to have it working sorta when I run it and save the

Re: subprocess.popen question

2007-06-23 Thread SPE - Stani's Python Editor
On Jun 23, 5:35 am, Gabriel Genellina [EMAIL PROTECTED] wrote: En Fri, 22 Jun 2007 10:08:49 -0300, [EMAIL PROTECTED] [EMAIL PROTECTED] escribió: I seemed to have it working sorta when I run it and save the results I am noticing that inspeit spaces correctly but when I save it to a file I

Re: subprocess.popen question

2007-06-22 Thread [EMAIL PROTECTED]
On Jun 22, 12:10 am, Gabriel Genellina [EMAIL PROTECTED] wrote: En Fri, 22 Jun 2007 01:05:36 -0300, [EMAIL PROTECTED] [EMAIL PROTECTED] escribió: cmd = [gawk, -f, altertime.awk, -v, time_offset=4, -v, outfile=testdat.sco, i1.sco] output = subprocess.Popen(cmd,

Re: subprocess.popen question

2007-06-22 Thread Gabriel Genellina
En Fri, 22 Jun 2007 10:08:49 -0300, [EMAIL PROTECTED] [EMAIL PROTECTED] escribió: I seemed to have it working sorta when I run it and save the results I am noticing that in spe it spaces correctly but when I save it to a file I can open it in wordpad there is only one line. when I open in

Re: subprocess.popen question

2007-06-21 Thread [EMAIL PROTECTED]
On Jun 21, 1:22 am, Gabriel Genellina [EMAIL PROTECTED] wrote: En Wed, 20 Jun 2007 22:28:06 -0300, [EMAIL PROTECTED] [EMAIL PROTECTED] escribió: On Jun 20, 7:50 pm, Gabriel Genellina [EMAIL PROTECTED] wrote: En Wed, 20 Jun 2007 20:02:52 -0300, [EMAIL PROTECTED] [EMAIL PROTECTED]

Re: subprocess.popen question

2007-06-21 Thread Gabriel Genellina
En Fri, 22 Jun 2007 01:05:36 -0300, [EMAIL PROTECTED] [EMAIL PROTECTED] escribió: cmd = [gawk, -f, altertime.awk, -v, time_offset=4, -v, outfile=testdat.sco, i1.sco] output = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0] lines = output.splitlines() for line in

Re: subprocess.popen question

2007-06-21 Thread Gabriel Genellina
En Wed, 20 Jun 2007 22:28:06 -0300, [EMAIL PROTECTED] [EMAIL PROTECTED] escribió: On Jun 20, 7:50 pm, Gabriel Genellina [EMAIL PROTECTED] wrote: En Wed, 20 Jun 2007 20:02:52 -0300, [EMAIL PROTECTED] [EMAIL PROTECTED] escribió: On Jun 20, 1:46 pm, Gabriel Genellina [EMAIL PROTECTED]

subprocess.popen question

2007-06-20 Thread [EMAIL PROTECTED]
I am trying to modify a programming example and I am coming up with two problems... first is that I can't seem to pass along the arguments to the external command (I have been able to do that with the old module and cmd is the command I wish to try) all the output seems to be returned as one line

Re: subprocess.popen question

2007-06-20 Thread Gabriel Genellina
En Wed, 20 Jun 2007 12:27:47 -0300, [EMAIL PROTECTED] [EMAIL PROTECTED] escribió: I am trying to modify a programming example and I am coming up with two problems... first is that I can't seem to pass along the arguments to the external command (I have been able to do that with the old

Re: subprocess.popen question

2007-06-20 Thread [EMAIL PROTECTED]
On Jun 20, 1:46 pm, Gabriel Genellina [EMAIL PROTECTED] wrote: En Wed, 20 Jun 2007 12:27:47 -0300, [EMAIL PROTECTED] [EMAIL PROTECTED] escribió: I am trying to modify a programming example and I am coming up with two problems... first is that I can't seem to pass along the arguments to

Re: subprocess.popen question

2007-06-20 Thread [EMAIL PROTECTED]
On Jun 20, 1:46 pm, Gabriel Genellina [EMAIL PROTECTED] wrote: En Wed, 20 Jun 2007 12:27:47 -0300, [EMAIL PROTECTED] [EMAIL PROTECTED] escribió: I am trying to modify a programming example and I am coming up with two problems... first is that I can't seem to pass along the arguments to

Re: subprocess.popen question

2007-06-20 Thread Gabriel Genellina
En Wed, 20 Jun 2007 20:02:52 -0300, [EMAIL PROTECTED] [EMAIL PROTECTED] escribió: On Jun 20, 1:46 pm, Gabriel Genellina [EMAIL PROTECTED] wrote: cmd = [gawk, -f, altertime.awk, -v, time_offset=4, -v, outfile=testdat.sco, i1.sco] Now, what do you want to do with the output? Printing it

Re: subprocess.popen question

2007-06-20 Thread [EMAIL PROTECTED]
On Jun 20, 7:50 pm, Gabriel Genellina [EMAIL PROTECTED] wrote: En Wed, 20 Jun 2007 20:02:52 -0300, [EMAIL PROTECTED] [EMAIL PROTECTED] escribió: On Jun 20, 1:46 pm, Gabriel Genellina [EMAIL PROTECTED] wrote: cmd = [gawk, -f, altertime.awk, -v, time_offset=4, -v,