[BangPypers] Using subprocess - Extra '0' on the console
Nikunj.Badjatya at emc.com
Nikunj.Badjatya at emc.com
Wed Feb 22 07:20:44 CET 2012
Any ideas anyone ?
-----Original Message-----
From: bangpypers-bounces+nikunj.badjatya=emc.com at python.org [mailto:bangpypers-bounces+nikunj.badjatya=emc.com at python.org] On Behalf Of Nikunj.Badjatya at emc.com
Sent: Tuesday, February 21, 2012 3:00 PM
To: mandarvaze at gmail.com; bangpypers at python.org
Subject: Re: [BangPypers] Using subprocess - Extra '0' on the console
No I am not printing anything.
From: Mandar Vaze / मंदार वझे [mailto:mandarvaze at gmail.com]
Sent: Tuesday, February 21, 2012 2:55 PM
To: Badjatya, Nikunj
Subject: Re: [BangPypers] Using subprocess - Extra '0' on the console
It is possible that this "zero" is return value i.e. success indicator
Are you printing "Status"
-Mandar
On Tue, Feb 21, 2012 at 2:32 PM, <Nikunj.Badjatya at emc.com<mailto:Nikunj.Badjatya at emc.com>> wrote:
Hi,
I am using subprocess module to run a powershell script with necessary arguments.
I also want to wait for this process to be over. The following statements works fine functionality wise.
Program.py:-
{{{
Ret = Popen([powershellpath, argslist])
Status = Ret.communicate()
}}}
Previously I was using threading.Thread() and subprocess.call() togethar to carry out this task.
But after using only Popen, I am noticing a extra '0' coming on the console in the new line.
Console:-
{{{
This is intended msg1
0
This is intended msg2
}}}
As you see, 1 new line and 1 extra '0' is coming on the console.
I checked thoroughly and I think its coming only after I used Popen().
Any ideas how to avoid this .?
Thanks,
Nikunj
7 Switch off as you go | qRecycle always | P Save Paper - Save Trees | Go Green
_______________________________________________
BangPypers mailing list
BangPypers at python.org<mailto:BangPypers at python.org>
http://mail.python.org/mailman/listinfo/bangpypers
_______________________________________________
BangPypers mailing list
BangPypers at python.org
http://mail.python.org/mailman/listinfo/bangpypers
More information about the BangPypers
mailing list