[BangPypers] Using subprocess - Extra '0' on the console

Nikunj.Badjatya at emc.com Nikunj.Badjatya at emc.com
Tue Feb 21 10:29:34 CET 2012

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"

On Tue, Feb 21, 2012 at 2:32 PM, <Nikunj.Badjatya at emc.com<mailto:Nikunj.Badjatya at emc.com>> wrote:

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.
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.
This is intended msg1

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 .?


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>

More information about the BangPypers mailing list