With pexpect.spawn , I have a program running in the background that sends back a line for each input line sent.
What would be the appropriate expect expression for getting the whole lines as output?
(after waiting until the line is there in the output)
I do not want to use any specific string (like a prompt), other than the newline to synchronize against.
I tried myprogram.expect('\r\n')
, but it seems to contain the input along with the output.
I tried myprogram.expect('\r\n'), but it seems to contain the input along with the output.
Does this mean the "\n" in input is considered?If yes, thereis a way to suppress the echo by settingset echo
to false. You can try that. Also can you paste the code that you are trying?