get output of cmd-line command under MS windows

calmar mac at calmar.ws
Fri Feb 10 13:19:33 EST 2006


On 2006-02-08, Bernard Lebel <3dbernard at gmail.com> wrote:

Hi Bernhard and all,

> oPipe = os.popen( "run C:/program files/my app/executable.exe" )
>
> while 1:
> 	sLine = oPipe.read()
> 	print sLine
> 	if sLine == '':
> 		print 'No more line from pipe, exit.'
> 		break
>

I see. I saw also os.popen("....").read() or so.

Anyway, not sure if that would also catch stderr?

But doesn't matter. It seems, imagemagick (binaries) won't provide
proper error-codes, but at least when it prints something, something was
not ok probably. 

I will check the resulting file, to see if everything went ok, and try
to catch the output like you mentioned.

thanks a lot
marco

-- 
  calmar

          (o_  It rocks: LINUX + Command-Line-Interface
          //\
          V_/_                     http://www.calmar.ws



More information about the Python-list mailing list