> Reading through other posts, looks like you got somewhare with the
> nonblocking IO. Can you comment on what you did to get it working? The
> whole fcntl thing?
I am able to use non-blocking I/O, but I am unable to get the mplayer
status messages. It's just not there in the mplayer output pipe.
hi Vinay,
Reading through other posts, looks like you got somewhare with the
nonblocking IO. Can you comment on what you did to get it working? The
whole fcntl thing?
Thanks,
Hugo
Vinay Reddy wrote:
> Hi,
> I am writing a front-end for an application (mplayer). I used the
> popen2 call to ope
Hi again =)
That's exactly why I use "quiet" with MPlayer, because the output is
simply too much to be parsed, and MPlayer will block waiting for you to
read the buffer (so it stops playing)
My suggestion is: forget about parsing the huge amounts of output
MPlayer gives, and use its slave mode
while True:
try:
temp = self.mplayerOut.readline()
print temp
if re.compile("^A:").search(temp):
The point of re.compile is to compile the re once *outside* the loop.
Compiling the re is slow so you should only do it outside.
As a first step replace re.compile with re.search
On Fri, 12 Aug 2005, Vinay Reddy wrote:
> I'm using the following code to read from 'mplayerOut':
>
> while True:
> try:
> temp = self.mplayerOut.readline()
>print temp
>if re.compile("^A:").search(temp):
> print "abc"
> except StandardError:
> break
>
> If th
Hi,
I am writing a front-end for an application (mplayer). I used the
popen2 call to open pipes for bi-directional communication.
I set the output pipe from the application to non-blocking mode using:
fcntl.fcntl(self.mplayerOut, fcntl.F_SETFL, os.O_NONBLOCK)
The problem is that it takes about 10