[Tutor] parsing through an output stream

Vinay Reddy vinayvinay at gmail.com
Mon Aug 15 06:10:42 CEST 2005


Hi,
I tried running mplayer from a python program using the popen2 command
and read the returned output stream in non-blocking mode. But, I did
not getting any of the status messages given out by mplayer (I did get
the initial dump by mplayer).

I am using the following to read the output:
try: # get the last line of output
   for status in self.mplayerOut:
      if not status: break
      print status
except StandardError:
  pass

MPlayer terminates a status line with a '\r'. Is that the problem? If
so, I want python to recognize \r as a line terminator. How do I do
this?

Any help will be appreciated.

Regards,
Vinay


More information about the Tutor mailing list