In article <[EMAIL PROTECTED]>,
Bernard Lebel  <[EMAIL PROTECTED]> wrote:
>You should give a go to os.popen( <system command here> ). 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 an
>empty line (indicating the running application is not running in this
>case).
>
>Example:
>
>import os
>
>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
                        .
                        .
                        .
If I understand you correctly, this presentation depends on
  executable.exe
not emitting any blank lines.  Some legitimate command-line
executables *do* have occasion to put out blank lines, though 
...
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to