On Fri, 19 Jun 2009 08:07:29 -0700
Tyler Laing <trinio...@gmail.com> wrote:

> I can't use communicate, as it waits for the child process to terminate.
> Basically it blocks. I'm trying to have dynamic communication between the
> python program, and vlc.

Unfortunately, subprocess module doesn't allow it out-of-the-box, but
you can use fnctl calls to perform non-blocking reads/writes on it's
pipes, like this:

  flags = fcntl.fcntl(fd, fcntl.F_GETFL)
  fcntl.fcntl(fd, fcntl.F_SETFL, flags | os.O_NONBLOCK)

After that, you can grab all the available data from the pipe at any
given time w/o blocking.

Try this recipe:

  http://code.activestate.com/recipes/576759/

-- 
Mike Kazantsev // fraggod.net

Attachment: signature.asc
Description: PGP signature

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to