Can I get use pexpect to control this process?

S

Saqib Ali

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().
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top