Re: get output of cmd-line command under MS windows

2006-02-14 Thread calmar
On 2006-02-08, Bernard Lebel <[EMAIL PROTECTED]> wrote: Hi Bernhard, > You should give a go to os.popen( ). Article > 6.1.2 and 6.1.3 in the Python Library doc. > that was good, but on python2.4 subprocess is GREAT! e.g.: pipe = subprocess.Popen(tot, stdout=subprocess.PIPE,\ s

Re: get output of cmd-line command under MS windows

2006-02-14 Thread Fredrik Lundh
"calmar" wrote: > that was good, but on python2.4 > > subprocess is GREAT! e.g.: > > pipe = subprocess.Popen(tot, stdout=subprocess.PIPE,\ > stderr=subprocess.PIPE, shell=False) > message = pipe.stdout.read() > error = pipe.stderr.read() footnote: subprocess is available f

Re: get output of cmd-line command under MS windows

2006-02-10 Thread calmar
On 2006-02-08, Bernard Lebel <[EMAIL PROTECTED]> 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.' >

Re: get output of cmd-line command under MS windows

2006-02-09 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Bernard Lebel <[EMAIL PROTECTED]> wrote: >You should give a go to os.popen( ). Article >6.1.2 and 6.1.3 in the Python Library doc. > >I recently wrote a program that would create a pipe using the popen() >method, and would enter a while loop. At each iteration, it

Re: get output of cmd-line command under MS windows

2006-02-08 Thread Bernard Lebel
You should give a go to os.popen( ). Article 6.1.2 and 6.1.3 in the Python Library doc. I recently wrote a program that would create a pipe using the popen() method, and would enter a while loop. At each iteration, it would read one line of the pipe output, and the loop would break when it gets a

get output of cmd-line command under MS windows

2006-02-08 Thread calmar
Hi all, unfotunately, 'commands.getstatusoutput(command)' does not work under windows. Would there be any alternative? os.system also just provides the exit number I think. thanks a lot, and cheers marco -- calmar (o_ It rocks: LINUX + Command-Line-Interface //\