I have a program X that constantly spews output, hundreds of lines per minute. X is not an interactive program. IE: it doesn't take any user input. It just produces a lot of textual output to STDOUT.
I would like to save the output produced by X into a different file every 5 seconds regardless of the actual content. I want one file to contain the output from seconds 0-5, another file should contain 6-10, etc. etc. Can I do this with pexpect? I'm not sure I can because the "before" argument gives me EVERYTHING upto the most recent match. What I really need is something that will give me what was produced between the last 2 calls to pexpect.expect(). -- http://mail.python.org/mailman/listinfo/python-list